(weakRef, delay)
| 200 | // the created timer object. Separately, we add the signal to a |
| 201 | // FinalizerRegistry that will clear the timeout when the signal is gc'd. |
| 202 | function setWeakAbortSignalTimeout(weakRef, delay) { |
| 203 | const timeout = setTimeout(() => { |
| 204 | const signal = weakRef.deref(); |
| 205 | if (signal !== undefined) { |
| 206 | clearTimeoutRegistry.unregister(signal); |
| 207 | gcPersistentSignals.delete(signal); |
| 208 | abortSignal( |
| 209 | signal, |
| 210 | new DOMException( |
| 211 | 'The operation was aborted due to timeout', |
| 212 | 'TimeoutError')); |
| 213 | } |
| 214 | }, delay); |
| 215 | timeout.unref(); |
| 216 | return timeout; |
| 217 | } |
| 218 | |
| 219 | class AbortSignal extends EventTarget { |
| 220 |
no test coverage detected
searching dependent graphs…