From 146e8ac83a3acba64849c20edef15266160514e7 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 29 Jan 2018 14:52:01 -0500 Subject: [PATCH] timers: remove domain specific code It is no longer necessary to explicitly set the handle to inherit the Timeout domain. PR-URL: https://github.com/nodejs/node/pull/18477 Refs: https://github.com/nodejs/node/pull/16222 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Khaidi Chu Reviewed-By: Jeremiah Senkpiel --- lib/timers.js | 1 - test/parallel/test-domain-timers.js | 8 +++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index d637ca91ae48e9..a6adbf74f255d6 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -603,7 +603,6 @@ Timeout.prototype.unref = function() { this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; this._handle.start(delay); - this._handle.domain = this.domain; this._handle.unref(); } return this; diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index fe7247b2a92c95..f9857a991af880 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -30,13 +30,19 @@ timeoutd.on('error', common.mustCall(function(e) { assert.strictEqual(e.message, 'Timeout UNREFd', 'Domain should catch timer error'); clearTimeout(timeout); -})); +}, 2)); +let t; timeoutd.run(function() { setTimeout(function() { throw new Error('Timeout UNREFd'); }, 0).unref(); + + t = setTimeout(function() { + throw new Error('Timeout UNREFd'); + }, 0); }); +t.unref(); const immediated = domain.create();