* Propagates abort from a parent to a weakly-referenced child controller. * Both parent and child are weakly held — neither direction creates a * strong reference that could prevent GC. * Module-scope function avoids per-call closure allocation.
( this: WeakRef<AbortController>, weakChild: WeakRef<AbortController>, )
| 28 | * Module-scope function avoids per-call closure allocation. |
| 29 | */ |
| 30 | function propagateAbort( |
| 31 | this: WeakRef<AbortController>, |
| 32 | weakChild: WeakRef<AbortController>, |
| 33 | ): void { |
| 34 | const parent = this.deref() |
| 35 | weakChild.deref()?.abort(parent?.signal.reason) |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Removes an abort handler from a weakly-referenced parent signal. |
nothing calls this directly
no outgoing calls
no test coverage detected