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 danielleadams committed Apr 3, 2023
1 parent 4d81124 commit 9b58857
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 9b58857

Please sign in to comment.