GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — lib: change abstract equal to strict equal by ZYSzys · Pull Request #22974 · nodejs/node Conversation
|
| throw new ERR_INVALID_ARG_TYPE('properties', 'Array', properties); | ||
|
|
||
| if (tabularData == null || typeof tabularData !== 'object') | ||
| if (tabularData === null || typeof tabularData !== 'object') |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's not obvious, but this significantly changes the semantics of the check in a non-backwards compatible way.
null == null; // true undefined == null; // true null === null; // true undefined === null; // false
The current check makes sure that tabularData is also not undefined.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
But the later one can check it, typeof undefined === 'undefined' so typeof tabularData !== 'object' is true.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is 100 % subjective, but maybe this would be a bit more Obviously Correct™ if the conditions were switched?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just not seeing the point of the change then if it simply shifts the undefined case a bit to the right.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just change to strict equal to unify the overall code style.
If there is any problem, feel free to close it.😜
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Nah, I'm not overly happy with it but I won't block it :-)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
See comment.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Resumed build: https://ci.nodejs.org/job/node-test-pull-request/17424/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #22974 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: #22974 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
|
Thanks all of you. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR-URL: #22974 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
PR-URL: #22974 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: John-David Dalton <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.