Skip to content

Commit 9b58857

Browse files
jasnelldanielleadams
authored andcommitted
timers: cleanup no-longer relevant TODOs in timers/promises
PR-URL: #46499 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 4d81124 commit 9b58857

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/timers/promises.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,8 @@ function setTimeout(after, value, options = kEmptyObject) {
7070
'boolean',
7171
ref));
7272
}
73-
// TODO(@jasnell): If a decision is made that this cannot be backported
74-
// to 12.x, then this can be converted to use optional chaining to
75-
// simplify the check.
76-
if (signal && signal.aborted) {
73+
74+
if (signal?.aborted) {
7775
return PromiseReject(new AbortError(undefined, { cause: signal.reason }));
7876
}
7977
let oncancel;
@@ -113,10 +111,8 @@ function setImmediate(value, options = kEmptyObject) {
113111
'boolean',
114112
ref));
115113
}
116-
// TODO(@jasnell): If a decision is made that this cannot be backported
117-
// to 12.x, then this can be converted to use optional chaining to
118-
// simplify the check.
119-
if (signal && signal.aborted) {
114+
115+
if (signal?.aborted) {
120116
return PromiseReject(new AbortError(undefined, { cause: signal.reason }));
121117
}
122118
let oncancel;

0 commit comments

Comments
 (0)