%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
// Flags: --expose-internals 'use strict'; require('../common'); const assert = require('assert'); const { sleep } = require('internal/util'); // Make sure we test 0ms timers, since they would had always wanted to run on // the current tick, and greater than 0ms timers, for scenarios where the // outer timer takes longer to complete than the delay of the nested timer. // Since the process of recreating this is identical regardless of the timer // delay, these scenarios are in one test. const scenarios = [0, 100]; scenarios.forEach(function(delay) { let nestedCalled = false; setTimeout(function A() { // Create the nested timer with the same delay as the outer timer so that it // gets added to the current list of timers being processed by // listOnTimeout. setTimeout(function B() { nestedCalled = true; }, delay); // Busy loop for the same timeout used for the nested timer to ensure that // we are in fact expiring the nested timer. sleep(delay); // The purpose of running this assert in nextTick is to make sure it runs // after A but before the next iteration of the libuv event loop. process.nextTick(function() { assert.ok(!nestedCalled); }); // Ensure that the nested callback is indeed called prior to process exit. process.on('exit', function onExit() { assert.ok(nestedCalled); }); }, delay); });