From e3497e84c67baf441069ee3ff6935f7326913fb7 Mon Sep 17 00:00:00 2001 From: Dylan Conway Date: Thu, 1 May 2025 14:21:40 -0700 Subject: [PATCH] nested --- .../timers-immediate-exception-fixture.js | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/test/js/node/timers/timers-immediate-exception-fixture.js b/test/js/node/timers/timers-immediate-exception-fixture.js index 956e8a0a30..bf3bc8bbec 100644 --- a/test/js/node/timers/timers-immediate-exception-fixture.js +++ b/test/js/node/timers/timers-immediate-exception-fixture.js @@ -6,7 +6,7 @@ process.on( if (err.message !== "oops") { throw err; } - }, 2), + }, 3), ); function checkNextTick(expected) { @@ -70,3 +70,37 @@ setImmediate( checkNextTick(7); }), ); + +setImmediate( + mustCall(() => { + counter++; + checkNextTick(8); + setImmediate( + mustCall(() => { + counter++; + checkNextTick(11); + }), + ); + }), +); + +setImmediate( + mustCall(() => { + counter++; + checkNextTick(9); + setImmediate( + mustCall(() => { + counter++; + checkNextTick(12); + throw new Error("oops"); + }), + ); + }), +); + +setImmediate( + mustCall(() => { + counter++; + checkNextTick(10); + }), +);