Skip to content

Commit

Permalink
timers: remove domain specific code
Browse files Browse the repository at this point in the history
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 <[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]>
  • Loading branch information
apapirovski authored and MylesBorins committed Feb 21, 2018
1 parent 935eac1 commit 146e8ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 7 additions & 1 deletion test/parallel/test-domain-timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 146e8ac

Please sign in to comment.