()
| 332 | } |
| 333 | |
| 334 | async function eventTargetAbortableOnAfter2() { |
| 335 | const et = new EventTarget(); |
| 336 | const ac = new AbortController(); |
| 337 | |
| 338 | const i = setInterval(() => et.dispatchEvent(new Event('foo')), 10); |
| 339 | |
| 340 | async function foo() { |
| 341 | for await (const f of on(et, 'foo', { signal: ac.signal })) { |
| 342 | assert(f); |
| 343 | // Cancel after a single event has been triggered. |
| 344 | ac.abort(); |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | foo().catch(common.mustCall((error) => { |
| 349 | assert.strictEqual(error.name, 'AbortError'); |
| 350 | })).finally(() => { |
| 351 | clearInterval(i); |
| 352 | }); |
| 353 | } |
| 354 | |
| 355 | async function abortableOnAfterDone() { |
| 356 | const ee = new EventEmitter(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…