MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / removeAbortHandler

Function removeAbortHandler

source code/utils/abortController.ts:46–55  ·  view source on GitHub ↗

* 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>,
)

Source from the content-addressed store, hash-verified

44 * Module-scope function avoids per-call closure allocation.
45 */
46function 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected