MCPcopy Index your code
hub / github.com/nodejs/node / onceWithEventTargetError

Function onceWithEventTargetError

test/parallel/test-events-once.js:133–142  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131}
132
133async function onceWithEventTargetError() {
134 const et = new EventTarget();
135 const error = new Event('error');
136 process.nextTick(() => {
137 et.dispatchEvent(error);
138 });
139
140 const [ err ] = await once(et, 'error');
141 assert.strictEqual(err, error);
142}
143
144async function onceWithInvalidEventEmmiter() {
145 const ac = new AbortController();

Callers 1

Calls 2

dispatchEventMethod · 0.95
onceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…