From fb640c66cbd82aad37ea2fa5db8d4f186bc6e1a0 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Wed, 27 Dec 2017 13:31:22 -0500 Subject: [PATCH] timers: remove domain enter and exit With domains implemented over AsyncHooks, it's no longer necessary to explicitly enter and exit the domain. PR-URL: https://github.com/nodejs/node/pull/17880 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Andreas Madsen --- lib/timers.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index c9202cc0908bb9..1560215fe0ad5d 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -256,15 +256,7 @@ function listOnTimeout() { continue; } - var domain = timer.domain; - if (domain) { - domain.enter(); - } - tryOnTimeout(timer, list); - - if (domain) - domain.exit(); } // If `L.peek(list)` returned nothing, the list was either empty or we have @@ -688,31 +680,22 @@ var immediateQueue = new ImmediateList(); function processImmediate() { var immediate = immediateQueue.head; var tail = immediateQueue.tail; - var domain; // Clear the linked list early in case new `setImmediate()` calls occur while // immediate callbacks are executed immediateQueue.head = immediateQueue.tail = null; while (immediate !== null) { - domain = immediate.domain; - if (!immediate._onImmediate) { immediate = immediate._idleNext; continue; } - if (domain) - domain.enter(); - // Save next in case `clearImmediate(immediate)` is called from callback var next = immediate._idleNext; tryOnImmediate(immediate, tail); - if (domain) - domain.exit(); - // If `clearImmediate(immediate)` wasn't called from the callback, use the // `immediate`'s next item if (immediate._idleNext !== null)