deno
89f33cbe - fix(ext/web): clean up abort handlers when listeners are removed (#36226)

Commit
20 days ago
fix(ext/web): clean up abort handlers when listeners are removed (#36226) ## Summary - detach an `AbortSignal` abort handler when its associated event listener is explicitly removed - apply the same cleanup when a `once` listener is consumed - reuse the already-known listener index during explicit removal - add regression coverage for both removal paths ## Root cause `addEventListener()` registered a handler on the supplied abort signal, but the event listener entry did not retain the state needed to unregister that handler. Removing the event listener therefore left the abort handler attached until the signal itself was aborted. The listener entry now tracks the paired signal and abort handler. A shared removal helper removes the event listener and detaches that handler for both explicit and `once` removal. ## Tests - `cargo build -p deno -p test_server` - `cargo test -p unit_tests --test unit -- event_target_test` - `./tools/format.js --check ext/web/02_event.js tests/unit/event_target_test.ts` - `./tools/lint.js --js`
Author
Parents
Loading