Skip to content

Conversation

lpinca
Copy link
Member

@lpinca lpinca commented Feb 10, 2019

Use emitter.listenerCount() instead of the length property of the
array returned by emitter.listeners().

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Use `emitter.listenerCount()` instead of the `length` property of the
array returned by `emitter.listeners()`.
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 10, 2019
@lpinca
Copy link
Member Author

lpinca commented Feb 10, 2019

I understand this has very little value but using ee.listeners('foo').length when ee.listenerCount('foo') exists, triggers my OCD.

It's ok if this is not accepted.

@danbev
Copy link
Contributor

danbev commented Feb 13, 2019

@addaleax
Copy link
Member

Landed in 2b090c1

@addaleax addaleax closed this Feb 13, 2019
addaleax pushed a commit that referenced this pull request Feb 13, 2019
Use `emitter.listenerCount()` instead of the `length` property of the
array returned by `emitter.listeners()`.

PR-URL: #26031
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@lpinca lpinca deleted the fix/ocd branch February 14, 2019 06:06
targos pushed a commit that referenced this pull request Feb 14, 2019
Use `emitter.listenerCount()` instead of the `length` property of the
array returned by `emitter.listeners()`.

PR-URL: #26031
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@targos targos mentioned this pull request Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants