Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 146e8ac

Browse filesBrowse files
apapirovskiMylesBorins
authored andcommitted
timers: remove domain specific code
It is no longer necessary to explicitly set the handle to inherit the Timeout domain. PR-URL: #18477 Refs: #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>
1 parent 935eac1 commit 146e8ac
Copy full SHA for 146e8ac

File tree

Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-2
lines changed
Open diff view settings
Collapse file

‎lib/timers.js‎

Copy file name to clipboardExpand all lines: lib/timers.js
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,6 @@ Timeout.prototype.unref = function() {
603603
this._handle.owner = this;
604604
this._handle[kOnTimeout] = unrefdHandle;
605605
this._handle.start(delay);
606-
this._handle.domain = this.domain;
607606
this._handle.unref();
608607
}
609608
return this;
Collapse file

‎test/parallel/test-domain-timers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain-timers.js
+7-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.