()
| 311 | } |
| 312 | |
| 313 | async function eventTargetAbortableOnAfter() { |
| 314 | const et = new EventTarget(); |
| 315 | const ac = new AbortController(); |
| 316 | |
| 317 | const i = setInterval(() => et.dispatchEvent(new Event('foo')), 10); |
| 318 | |
| 319 | async function foo() { |
| 320 | for await (const f of on(et, 'foo', { signal: ac.signal })) { |
| 321 | assert(f); |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | foo().catch(common.mustCall((error) => { |
| 326 | assert.strictEqual(error.name, 'AbortError'); |
| 327 | })).finally(() => { |
| 328 | clearInterval(i); |
| 329 | }); |
| 330 | |
| 331 | process.nextTick(() => ac.abort()); |
| 332 | } |
| 333 | |
| 334 | async function eventTargetAbortableOnAfter2() { |
| 335 | const et = new EventTarget(); |
nothing calls this directly
no test coverage detected
searching dependent graphs…