FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

events: remove unnecessary checks by cjihrig · Pull Request #9330 · nodejs/node · GitHub

/ node Public

events: remove unnecessary checks - #9330

Merged
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:events
Oct 31, 2016
Merged

events: remove unnecessary checks#9330
cjihrig merged 1 commit into
nodejs:masterfrom
cjihrig:events

Conversation

cjihrig commented Oct 27, 2016

Copy link
Copy Markdown
Contributor
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

events

Description of change

This commit removes two truthy checks for object properties that are immediately followed by a strict equality check. The other item in the comparison is guaranteed to be a function by this point in the code, so the truthy check is redundant.

nodejs-github-bot added the events Issues and PRs related to the events subsystem / EventEmitter. label Oct 27, 2016

Trott 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. Out of curiosity, are you locating these bits of unreachable code by looking at the test coverage?

cjihrig commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

Not for this particular PR, but for the other similar PRs that I opened recently, yes.

cjihrig commented Oct 28, 2016

Copy link
Copy Markdown
Contributor Author

Trott commented Oct 28, 2016

Copy link
Copy Markdown
Member

I'm stopping the freebsd11-x64 build on CI for this because it looks like it detached from Jenkins. Until it stops, I don't think the host won't be free for other jobs to use. :-(

addaleax 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

This commit removes two truthy checks for object properties that
are immediately followed by a strict equality check. The other
item in the comparison is guaranteed to be a function by this
point in the code, so the truthy check is redundant.

PR-URL: nodejs#9330
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
cjihrig merged commit 7f909c3 into nodejs:master Oct 31, 2016
cjihrig deleted the events branch October 31, 2016 19:58
evanlucas pushed a commit that referenced this pull request Nov 3, 2016
This commit removes two truthy checks for object properties that
are immediately followed by a strict equality check. The other
item in the comparison is guaranteed to be a function by this
point in the code, so the truthy check is redundant.

PR-URL: #9330
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

Copy link
Copy Markdown
Contributor

@cjihrig is this applicable to v4 or v6?

cjihrig commented Nov 22, 2016

Copy link
Copy Markdown
Contributor Author

If the code is on the other branches, then I'd say it's applicable. It's just a JS simplification.

MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
This commit removes two truthy checks for object properties that
are immediately followed by a strict equality check. The other
item in the comparison is guaranteed to be a function by this
point in the code, so the truthy check is redundant.

PR-URL: #9330
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Dec 21, 2016
This commit removes two truthy checks for object properties that
are immediately followed by a strict equality check. The other
item in the comparison is guaranteed to be a function by this
point in the code, so the truthy check is redundant.

PR-URL: #9330
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins mentioned this pull request Dec 21, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

6 participants


Back | FazBrowse Home | New Git URL