-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Force strict comparison #2392
Force strict comparison #2392
Conversation
This patch replaces all the non-strict comparisons with equivalent strict comparisons.
This patch replaces all the non-strict comparisons with equivalent strict comparisons.
CI is Green (the only failing test's failure is not because of this change) |
+1 |
Better review and merge this asap to avoid lots of merge conflicts in the future. |
I would also immediately update lint options to enforce this, or it will slowly trickle back into the codebase. |
cc @nodejs/collaborators |
This seems extremely likely to cause regressions. Just glancing over the code, I see a lot of cases where input that would previously be accepted (e.g. |
perhaps @domenic is right and the PR is overzealous; therefore, each case should be looked at carefully. At any rate, i think this effort is moving the codebase in the right direction! @thefourtheye nice PR! I'm in favor. :) +1 |
I don't think any changes should be done in an automated way. I think every single change needs to be reviewed extremely carefully. |
I agree, I would be doing the changes manually only. |
Agree 100% with @domenic regarding risk of subtle bugs. I'd definitely want to see this run through whatever smoke testing is available at this point. While I favor the "always use strict equals" style, I'm not convinced retrofitting it here is the way to go. In addition to the subtle bugs risk, a couple other concerns:
I would prefer this sort of thing be split into multiple PRs with related changes grouped together so that they can be more easily and confidently reviewed. I acknowledge that it's more tedious for the submitter and time-consuming that way. |
So close this and chunk it up? Makes sense to everyone I guess. |
Closing this, as the change could lead to unexpected consequences. |
Based on the comments, I submitted another patch at #2582, which simply uses strict operators with string comparison. PTAL. |
This patch replaces all the non-strict comparisons to strict comparisons.
CI Run: node-test-pull-request/94