Skip to content

Commit

Permalink
timers: cleanup no-longer relevant TODOs in timers/promises
Browse files Browse the repository at this point in the history
PR-URL: #46499
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jasnell authored and MylesBorins committed Feb 18, 2023
1 parent 6bf7388 commit 6f24f06
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/timers/promises.js
Expand Up @@ -70,10 +70,8 @@ function setTimeout(after, value, options = kEmptyObject) {
'boolean',
ref));
}
// TODO(@jasnell): If a decision is made that this cannot be backported
// to 12.x, then this can be converted to use optional chaining to
// simplify the check.
if (signal && signal.aborted) {

if (signal?.aborted) {
return PromiseReject(new AbortError(undefined, { cause: signal.reason }));
}
let oncancel;
Expand Down Expand Up @@ -113,10 +111,8 @@ function setImmediate(value, options = kEmptyObject) {
'boolean',
ref));
}
// TODO(@jasnell): If a decision is made that this cannot be backported
// to 12.x, then this can be converted to use optional chaining to
// simplify the check.
if (signal && signal.aborted) {

if (signal?.aborted) {
return PromiseReject(new AbortError(undefined, { cause: signal.reason }));
}
let oncancel;
Expand Down

0 comments on commit 6f24f06

Please sign in to comment.