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 <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
jasnell authored Feb 5, 2023
1 parent 03854f6 commit 06b28fb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/timers/promises.js
Original file line number Diff line number Diff line change
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 06b28fb

Please sign in to comment.