Skip to content

Commit 00ae73d

Browse files
apapirovskiMayaLekova
authored andcommitted
timers: remove domain specific code
It is no longer necessary to explicitly set the handle to inherit the Timeout domain. PR-URL: nodejs#18477 Refs: nodejs#16222 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Khaidi Chu <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
1 parent e2a8240 commit 00ae73d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/timers.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,6 @@ Timeout.prototype.unref = function() {
586586
this._handle.owner = this;
587587
this._handle[kOnTimeout] = unrefdHandle;
588588
this._handle.start(delay);
589-
this._handle.domain = this.domain;
590589
this._handle.unref();
591590
}
592591
return this;

test/parallel/test-domain-timers.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ timeoutd.on('error', common.mustCall(function(e) {
3030
assert.strictEqual(e.message, 'Timeout UNREFd',
3131
'Domain should catch timer error');
3232
clearTimeout(timeout);
33-
}));
33+
}, 2));
3434

35+
let t;
3536
timeoutd.run(function() {
3637
setTimeout(function() {
3738
throw new Error('Timeout UNREFd');
3839
}, 0).unref();
40+
41+
t = setTimeout(function() {
42+
throw new Error('Timeout UNREFd');
43+
}, 0);
3944
});
45+
t.unref();
4046

4147
const immediated = domain.create();
4248

0 commit comments

Comments
 (0)