Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: refactor to remove optional chaining in events.js #36539

Conversation

RaisinTen
Copy link
Contributor

Refs: #36528

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the events Issues and PRs related to the events subsystem / EventEmitter. label Dec 16, 2020
Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

Why would we want to remove optional chaining?

@RaisinTen
Copy link
Contributor Author

The reviewers in the referenced PR mentioned that it might have a performance impact and it hinders readability.

@jasnell
Copy link
Member

jasnell commented Dec 16, 2020

Since I left the original comment on the performance there have been a few benchmark runs that show the performance with the chaining is good! I'd go ahead and just leave this as is.

@Lxxyx
Copy link
Member

Lxxyx commented Dec 16, 2020

You can look at this pull request: #36524, optional chaining performance looks good.

@RaisinTen
Copy link
Contributor Author

Thanks for letting me know. I'll try to add optional chaining to other modules then.

@RaisinTen RaisinTen closed this Dec 16, 2020
@RaisinTen RaisinTen deleted the lib/refactor-to-remove-optional-chaining-in-events.js branch December 16, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
events Issues and PRs related to the events subsystem / EventEmitter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants