From 0ab77ceb738f2260d3b8941964fbe11ed8e7842f 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. --- lib/timers.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index e061147828e25f..c722f6d8ae9497 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 @@ -641,31 +633,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)