* 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>, )
| 42 | * Module-scope function avoids per-call closure allocation. |
| 43 | */ |
| 44 | function removeAbortHandler( |
| 45 | this: WeakRef<AbortController>, |
| 46 | weakHandler: WeakRef<(...args: unknown[]) => void>, |
| 47 | ): void { |
| 48 | const parent = this.deref() |
| 49 | const handler = weakHandler.deref() |
| 50 | if (parent && handler) { |
| 51 | parent.signal.removeEventListener('abort', handler) |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Creates a child AbortController that aborts when its parent aborts. |
nothing calls this directly
no outgoing calls
no test coverage detected