%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'use strict'; const common = require('../common'); const { scheduler } = require('timers/promises'); const { setTimeout } = require('timers'); const { strictEqual, rejects, } = require('assert'); async function testYield() { await scheduler.yield(); process.emit('foo'); } testYield().then(common.mustCall()); queueMicrotask(common.mustCall(() => { process.addListener('foo', common.mustCall()); })); async function testWait() { let value = 0; setTimeout(() => value++, 10); await scheduler.wait(15); strictEqual(value, 1); } testWait().then(common.mustCall()); async function testCancelableWait1() { const ac = new AbortController(); const wait = scheduler.wait(1e6, { signal: ac.signal }); ac.abort(); await rejects(wait, { code: 'ABORT_ERR', message: 'The operation was aborted', }); } testCancelableWait1().then(common.mustCall()); async function testCancelableWait2() { const wait = scheduler.wait(10000, { signal: AbortSignal.abort() }); await rejects(wait, { code: 'ABORT_ERR', message: 'The operation was aborted', }); } testCancelableWait2().then(common.mustCall());