From 9b58857630fca0cb4147a700a3ba4e861b384b0c Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sun, 5 Feb 2023 02:12:16 -0800 Subject: [PATCH] timers: cleanup no-longer relevant TODOs in timers/promises PR-URL: https://github.com/nodejs/node/pull/46499 Reviewed-By: Moshe Atlow Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca --- lib/timers/promises.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/timers/promises.js b/lib/timers/promises.js index 7c8d364b1dde4f..4d23d15cc116fb 100644 --- a/lib/timers/promises.js +++ b/lib/timers/promises.js @@ -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;