Version
v26.7.0
Platform
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.
Version
v26.7.0
Platform
Subsystem
events
What steps will reproduce the bug?
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,
invocationsshould be0.What do you see instead?
The event listener is not removed,
invocationsis1.Additional information
Running the code under Node.js and popular browsers results in differing output. Chrome, Firefox and Safari all print
0, Node.js prints1.This can cause memory leaks, unexpected application behaviour, etc.