* Removes an abort handler from a weakly-referenced parent signal. * Both parent and handler are weakly held — if either has been GC'd * or the parent already aborted ({once: true}), this is a no-op. * Module-scope function avoids per-call closure allocation.
( this: WeakRef<AbortController>, weakHandler: WeakRef<(...args: unknown[]) => void>, )
| 44 | * Module-scope function avoids per-call closure allocation. |
| 45 | */ |
| 46 | function removeAbortHandler( |
| 47 | this: WeakRef<AbortController>, |
| 48 | weakHandler: WeakRef<(...args: unknown[]) => void>, |
| 49 | ): void { |
| 50 | const parent = this.deref() |
| 51 | const handler = weakHandler.deref() |
| 52 | if (parent && handler) { |
| 53 | parent.signal.removeEventListener('abort', handler) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Creates a child AbortController that aborts when its parent aborts. |
nothing calls this directly
no outgoing calls
no test coverage detected