| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,7 +171,7 @@ ObjectDefineProperty(setTimeout, customPromisify, { | |||
| 171 | 171 | }); | |
| 172 | 172 | ||
| 173 | 173 | function clearTimeout(timer) { | |
| 174 | - if (timer && timer._onTimeout) { | ||
| 174 | + if (timer?._onTimeout) { | ||
| 175 | 175 | timer._onTimeout = null; | |
| 176 | 176 | unenroll(timer); | |
| 177 | 177 | return; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,10 +49,7 @@ function setTimeout(after, value, options = {}) { | |||
| 49 | 49 | 'boolean', | |
| 50 | 50 | ref)); | |
| 51 | 51 | } | |
| 52 | - // TODO(@jasnell): If a decision is made that this cannot be backported | ||
| 53 | - // to 12.x, then this can be converted to use optional chaining to | ||
| 54 | - // simplify the check. | ||
| 55 | - if (signal && signal.aborted) { | ||
| 52 | + if (signal?.aborted) { | ||
| 56 | 53 | return PromiseReject(new AbortError()); | |
| 57 | 54 | } | |
| 58 | 55 | let oncancel; | |
@@ -94,10 +91,7 @@ function setImmediate(value, options = {}) { | |||
| 94 | 91 | 'boolean', | |
| 95 | 92 | ref)); | |
| 96 | 93 | } | |
| 97 | - // TODO(@jasnell): If a decision is made that this cannot be backported | ||
| 98 | - // to 12.x, then this can be converted to use optional chaining to | ||
| 99 | - // simplify the check. | ||
| 100 | - if (signal && signal.aborted) { | ||
| 94 | + if (signal?.aborted) { | ||
| 101 | 95 | return PromiseReject(new AbortError()); | |
| 102 | 96 | } | |
| 103 | 97 | let oncancel; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments