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 b3ca1b3

Browse filesBrowse files
gioragutttargos
authored andcommitted
timers: remove redundant unref calls
PR-URL: #38320 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 769a210 commit b3ca1b3
Copy full SHA for b3ca1b3

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎lib/timers/promises.js‎

Copy file name to clipboardExpand all lines: lib/timers/promises.js
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ function setTimeout(after, value, options = {}) {
6161
}
6262
let oncancel;
6363
const ret = new Promise((resolve, reject) => {
64-
const timeout = new Timeout(resolve, after, args, false, true);
65-
if (!ref) timeout.unref();
64+
const timeout = new Timeout(resolve, after, args, false, ref);
6665
insert(timeout, timeout._idleTimeout);
6766
if (signal) {
6867
oncancel = FunctionPrototypeBind(cancelListenerHandler,
@@ -141,8 +140,7 @@ async function* setInterval(after, value, options = {}) {
141140
callback();
142141
callback = undefined;
143142
}
144-
}, after, undefined, true, true);
145-
if (!ref) interval.unref();
143+
}, after, undefined, true, ref);
146144
insert(interval, interval._idleTimeout);
147145
if (signal) {
148146
onCancel = () => {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.