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

net: prefer === to == by notarseniy · Pull Request #11513 · nodejs/node · GitHub

/ node Public

net: prefer === to == - #11513

Closed
notarseniy wants to merge 1 commit into
nodejs:masterfrom
notarseniy:net-minor-refactor
Closed

net: prefer === to ==#11513
notarseniy wants to merge 1 commit into
nodejs:masterfrom
notarseniy:net-minor-refactor

Conversation

notarseniy commented Feb 22, 2017
edited
Loading

Copy link
Copy Markdown
Contributor
  • Prefer === to == in one condition
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

net

nodejs-github-bot added the net Issues and PRs related to the net subsystem. label Feb 22, 2017

Copy link
Copy Markdown
Member

vkurchatkin added the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 23, 2017
jasnell previously approved these changes Feb 23, 2017

Copy link
Copy Markdown
Contributor

This is a serious breaking change

jasnell commented Feb 23, 2017

Copy link
Copy Markdown
Member

ah, yes, good point. The status change should be ok, but the options.fd change is not.

jasnell dismissed their stale review February 23, 2017 00:28

Second thoughts... needs some tweaking to avoid the breaking change

notarseniy commented Feb 23, 2017
edited
Loading

Copy link
Copy Markdown
Contributor Author

Sorry to ask this, but can someone explain what exactly is the breakdown? It seems that I something misunderstood :( What the breaking case?

Comment thread lib/net.js Outdated

Trott Feb 23, 2017
edited
Loading

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

If I'm following the code correctly, this could conceivably be a breaking change for some. Since options.fd can be provided by the end user, it may be a string. Before this change, passing in '1' would have the same effect as 1. But now it won't. It only affects whether stdout and stderr are blocking or not on Windows. ¯\(ツ)/¯ @nodejs/platform-windows

Copy link
Copy Markdown
Contributor Author

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

Ah, got it. Thank you!
Hmm, and what are workarounds? ParseInt'ing? (looks like hack :( ) Leave it as is? (options.fd can be === true, thats not okay?)

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

Well, you could just leave ==. :-D

options.fd = +options.fd should make it a number too. There are also bit-shifting things I think that might be more efficient.

But ultimately, I'm not sure this needs to be changed at all.

notarseniy force-pushed the net-minor-refactor branch 3 times, most recently from e59eaa4 to 89fa167 Compare February 24, 2017 04:21

Copy link
Copy Markdown
Contributor Author

Reverted options.fd-related corrections. Added comment before if-statements for explaining these two non-strict comparisons with link to this PR.

semver-major label now can be removed. Thanks to @vkurchatkin for pointing this out.

Trott removed the semver-major PRs that contain breaking changes and should be released in the next major version. label Feb 24, 2017

cjihrig left a comment

Copy link
Copy Markdown
Contributor

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 with a nit.

Comment thread lib/net.js Outdated

Copy link
Copy Markdown
Contributor

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

Instead of saying this and linking to a GitHub issue, could you just explain the legacy reasons.

* Change === to == in one place
* Add explanation about another non-strict if-statement

Copy link
Copy Markdown
Contributor Author

Expanded commit message; made comment on options.fd more better.

jasnell commented Feb 25, 2017

Copy link
Copy Markdown
Member

jasnell pushed a commit that referenced this pull request Feb 27, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

jasnell commented Feb 27, 2017

Copy link
Copy Markdown
Member

Landed in 84c448e

jasnell closed this Feb 27, 2017
notarseniy deleted the net-minor-refactor branch February 27, 2017 22:54
italoacasas pushed a commit to italoacasas/node that referenced this pull request Feb 28, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: nodejs#11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
italoacasas mentioned this pull request Feb 28, 2017
jasnell pushed a commit that referenced this pull request Mar 7, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
jasnell pushed a commit that referenced this pull request Mar 7, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins mentioned this pull request Mar 9, 2017
MylesBorins pushed a commit that referenced this pull request Mar 9, 2017
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins mentioned this pull request Mar 9, 2017
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

net Issues and PRs related to the net subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants


Back | FazBrowse Home | New Git URL