You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EventTarget removeEventListener does not match all listeners #65244
Darwin Mac.localdomain 25.5.0 Darwin Kernel Version 25.5.0: Mon Apr 27 20:41:15 PDT 2026; root:xnu-12377.121.6~2/RELEASE_ARM64_T6041 arm64
Subsystem
events
What steps will reproduce the bug?
letinvocations=0constlistener=()=>{invocations++}consttarget=newEventTarget()// add the listenertarget.addEventListener('test',listener,true)// remove the listenertarget.removeEventListener('test',listener,true)// dispatch an eventtarget.dispatchEvent(newEvent('test'))// invocations should be 0console.info('invocations',invocations)
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
All matching event listeners should be removed, invocations should be 0.
What do you see instead?
The event listener is not removed, invocations is 1.
Additional information
Running the code under Node.js and popular browsers results in differing output. Chrome, Firefox and Safari all print 0, Node.js prints 1.
This can cause memory leaks, unexpected application behaviour, etc.
Activity
test: add coverage for removeEventListener boolean capture
test: add coverage for removeEventListener boolean capture
test: add coverage for removeEventListener boolean capture
test: add coverage for removeEventListener boolean capture
test: add coverage for removeEventListener boolean capture