Skip to content

events: accept boolean options in removeEventListener - #65245

Open
lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-65244-remove-listener-capture-boolean
Open

events: accept boolean options in removeEventListener#65245
lazerg wants to merge 1 commit into
nodejs:mainfrom
lazerg:fix/issue-65244-remove-listener-capture-boolean

Conversation

@lazerg

@lazerg lazerg commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

removeEventListener() read capture off the options object only, so the boolean shorthand target.removeEventListener('foo', fn, true) was flattened to capture: false and never matched a listener registered with capture on. addEventListener() already handles the boolean form, so the two went out of sync and the listener stayed attached. Browsers remove it.

Fixes #65244

Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 12, 2026
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.29%. Comparing base (00f0f8c) to head (dd80e58).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65245      +/-   ##
==========================================
- Coverage   90.31%   90.29%   -0.02%     
==========================================
  Files         760      760              
  Lines      248637   248637              
  Branches    46942    46929      -13     
==========================================
- Hits       224556   224516      -40     
- Misses      15475    15520      +45     
+ Partials     8606     8601       -5     
Files with missing lines Coverage Δ
lib/internal/event_target.js 99.18% <100.00%> (ø)

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventTarget removeEventListener does not match all listeners

2 participants