Skip to content

events: fix undefined passes to arrayClone - #56264

Closed
origranot wants to merge 3 commits into
nodejs:mainfrom
origranot:patch-1
Closed

events: fix undefined passes to arrayClone#56264
origranot wants to merge 3 commits into
nodejs:mainfrom
origranot:patch-1

Conversation

@origranot

@origranotorigranot commented Dec 15, 2024

Copy link
Copy Markdown
Contributor

Fixes#56263

Another suggestion is to force developers to pass a string, else throw an ERR_INVALID_ARG_TYPE but this should consider a breaking change.

Looking forward for your feedback!

@nodejs-github-botnodejs-github-bot added events Issues and PRs related to the events subsystem / EventEmitter. needs-ci PRs that need a full CI run. labels Dec 15, 2024
@anonrig

Copy link
Copy Markdown
Member

Please add a test case

@origranot

Copy link
Copy Markdown
ContributorAuthor

Please add a test case

Done 💯

@codecov

codecovBot commented Dec 16, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.54%. Comparing base (a50f3d5) to head (6b93137).
Report is 21 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #56264 +/- ##
==========================================
- Coverage 88.55% 88.54% -0.01% 
==========================================
Files 657 657 Lines 190243 190245 +2 Branches 36536 36542 +6 ==========================================
- Hits 168461 168457 -4 - Misses 14963 14968 +5 - Partials 6819 6820 +1 
Files with missing linesCoverage Δ
lib/events.js99.83% <100.00%> (+<0.01%)⬆️

... and 25 files with indirect coverage changes

@lpinca

Copy link
Copy Markdown
Member

This patch makes me wonder if 7a461ed was a good idea. I find it harder to read it now. I would revert 7a461ed and add the test included here.

@jakecastellijakecastelli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually open to (prefer to) revert and add a test as well

@jazellyjazelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a private chat with @jakecastelli. I think it's better to revert this and add a test.

@origranot Would you like to raise a new PR to revert the commit and introduce a new commit to add the test?

@origranot

Copy link
Copy Markdown
ContributorAuthor

Had a private chat with @jakecastelli. I think it's better to revert this and add a test.

@origranot Would you like to raise a new PR to revert the commit and introduce a new commit to add the test?

Yea, I am on it.

Thanks!

@origranot

origranot commented Dec 17, 2024

Copy link
Copy Markdown
ContributorAuthor

@jazelly
I opened a new PR here: #56282

@lpinca

Copy link
Copy Markdown
Member

Closed in favor of #56282.

@lpincalpinca closed this Dec 19, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eventsIssues and PRs related to the events subsystem / EventEmitter.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EventEmitter] TypeError when calling .listeners() without arguments

7 participants

@origranot@anonrig@lpinca@himself65@jazelly@jakecastelli@nodejs-github-bot