GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — EventTarget removeEventListener does not match all listeners · Issue #65244 · nodejs/node

EventTarget removeEventListener does not match all listeners #65244

New issue
Copy link
New issue
Copy link
Closed
#65245
Closed
EventTarget removeEventListener does not match all listeners#65244
#65245
Copy link
Labels
eventsIssues and PRs related to EventEmitter and the events module.

Description

@achingbrain
achingbrain
opened on Aug 12, 2026
Issue body actions

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?

let invocations = 0
const listener = () => {
  invocations++
}

const target = new EventTarget()

// add the listener
target.addEventListener('test', listener, true)

// remove the listener
target.removeEventListener('test', listener, true)

// dispatch an event
target.dispatchEvent(new Event('test'))

// invocations should be 0
console.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

  1. trivikr
    added
    eventsIssues and PRs related to EventEmitter and the events module.
    on Aug 18, 2026
  2. nodejs-github-bot
    closed this as completedin #65245on Aug 27, 2026
  3. nodejs-github-bot
    added a commit that references this issue on Aug 27, 2026

    test: add coverage for removeEventListener boolean capture

    4173ae2
  4. aduh95
    added 2 commits that reference this issue on Aug 29, 2026

    test: add coverage for removeEventListener boolean capture

    f3b5719

    test: add coverage for removeEventListener boolean capture

    b925c8f
  5. aduh95
    added a commit that references this issue on Sep 15, 2026

    test: add coverage for removeEventListener boolean capture

    5c680a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    eventsIssues and PRs related to EventEmitter and the events module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.