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 <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
parent
7020bc6e07
commit
fc96743454
@ -586,7 +586,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;
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user