timers: cleanup no-longer relevant TODOs in timers/promises

PR-URL: https://github.com/nodejs/node/pull/46499
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
pull/46600/head
James M Snell 2023-02-05 02:12:16 -08:00 committed by GitHub
parent 03854f6487
commit 06b28fbadc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -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;
@ -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;