* Register a handler for an AbortSignal, handling the already-aborted case. * If the signal is already aborted, calls handler immediately. * Otherwise, adds a one-time 'abort' listener. * @param {AbortSignal} signal * @param {Function} handler
(signal, handler)
| 62 | * @param {Function} handler |
| 63 | */ |
| 64 | function onSignalAbort(signal, handler) { |
| 65 | if (signal.aborted) { |
| 66 | handler(); |
| 67 | } else { |
| 68 | signal.addEventListener('abort', handler, { __proto__: null, once: true }); |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Compute the minimum cursor across a set of consumers and count how many |
no test coverage detected