| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4afcd55 commit a0261d2
2 files changed
| 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?._onTimeout) { | ||
| 174 | + if (timer && timer._onTimeout) { | ||
| 175 | 175 | timer._onTimeout = null; | |
| 176 | 176 | unenroll(timer); | |
| 177 | 177 | return; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,10 @@ function setTimeout(after, value, options = {}) { | |||
| 53 | 53 | 'boolean', | |
| 54 | 54 | ref)); | |
| 55 | 55 | } | |
| 56 | - if (signal?.aborted) { | ||
| 56 | + // TODO(@jasnell): If a decision is made that this cannot be backported | ||
| 57 | + // to 12.x, then this can be converted to use optional chaining to | ||
| 58 | + // simplify the check. | ||
| 59 | + if (signal && signal.aborted) { | ||
| 57 | 60 | return PromiseReject(new AbortError()); | |
| 58 | 61 | } | |
| 59 | 62 | let oncancel; | |
@@ -95,7 +98,10 @@ function setImmediate(value, options = {}) { | |||
| 95 | 98 | 'boolean', | |
| 96 | 99 | ref)); | |
| 97 | 100 | } | |
| 98 | - if (signal?.aborted) { | ||
| 101 | + // TODO(@jasnell): If a decision is made that this cannot be backported | ||
| 102 | + // to 12.x, then this can be converted to use optional chaining to | ||
| 103 | + // simplify the check. | ||
| 104 | + if (signal && signal.aborted) { | ||
| 99 | 105 | return PromiseReject(new AbortError()); | |
| 100 | 106 | } | |
| 101 | 107 | let oncancel; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments