Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
[v14.x backport] util: fix module inspection & instanceof check during inspect#37100
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Pezmc commented Jan 27, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#36151 PR-URL: nodejs#36178Fixes: nodejs#35730 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#35730 PR-URL: nodejs#36178Fixes: nodejs#36151 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
54da1e1 to a38c661ComparePezmc commented Jan 27, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I don't have the Jekins permissions to schedule a node-test-pull-request CI job for this PR (37100)
|
nodejs-github-bot commented Jan 27, 2021
nodejs-github-bot commented Jan 27, 2021 • edited by BethGriggs
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by BethGriggs
Uh oh!
There was an error while loading. Please reload this page.
BethGriggs commented Jan 27, 2021
Would appreciate a review from someone more familiar with this area (cc @nodejs/modules?) |
ljharb left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; i'll make similar changes in object-inspect.
| functionisInstanceof(object,proto){ | ||
| try{ | ||
| returnobjectinstanceofproto; | ||
| }catch{ | ||
| returnfalse; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the try/catch needed? are we worried about someone defining a Symbol.hasInstance method that can throw?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on cb9eec9#r527685177, instanceof can throw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, didn't realize this was a backport PR. turns out instanceof can indeed throw when the RHS is not a function, or when it's a non-constructible function (like an arrow function or a concise method)
98f6155 to 9ff73fcCompareBackport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#36151 PR-URL: nodejs#36178Fixes: nodejs#35730 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#35730 PR-URL: nodejs#36178Fixes: nodejs#36151 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Pezmc commented Jan 29, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@BethGriggs I tried rebasing onto the latest $ git fetch upstream v14.x-staging From https://github.com/nodejs/node * branch v14.x-staging -> FETCH_HEAD $ git checkout --track upstream/v14.x-staging Updating files: 100% (14760/14760), done. Branch 'v14.x-staging'set up to track remote branch 'v14.x-staging' from 'upstream'. Switched to a new branch 'v14.x-staging' $ git pull Already up to date. $ git checkout backport-36178-to-v14.x Switched to branch 'backport-36178-to-v14.x' $ git rebase v14.x-staging Successfully rebased and updated refs/heads/backport-36178-to-v14.x. $ git checkout -B backport-36178-to-v14.x-test Switched to a new branch 'backport-36178-to-v14.x-test' $ git push |
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#36151 PR-URL: nodejs#36178Fixes: nodejs#35730 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#35730 PR-URL: nodejs#36178Fixes: nodejs#36151 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
BethGriggs commented Jan 29, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Ah yes, that commit was backed out of staging as there was an npm version mismatch (ref: #37107 (comment)). We need to reland the npm update in a new PR. For this PR, I think you could either rebase against The good news is that the delay in fixing the npm update means we can probably squeeze this into v14.15.5 (#37074) |
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#36151 PR-URL: nodejs#36178Fixes: nodejs#35730 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Backport-PR-URL: nodejs#37100 Signed-off-by: Ruben Bridgewater <[email protected]> Fixes: nodejs#35730 PR-URL: nodejs#36178Fixes: nodejs#36151 Refs: nodejs#35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
a38c661 to ce8caa4ComparePezmc commented Jan 29, 2021
Re-rebased and manually dropped that commit, this PR should be good to go @BethGriggs! |
Pezmc commented Jan 29, 2021
Accidental close, please ignore! |
nodejs-github-bot commented Jan 29, 2021 • edited by BethGriggs
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by BethGriggs
Uh oh!
There was an error while loading. Please reload this page.
Pezmc commented Feb 1, 2021
@BethGriggs Anything I can do to help get this into v14.15.5? |
BethGriggs commented Feb 3, 2021
@Pezmc, I'll aim to integrate this into the v14.15.5 proposal - i'm still waiting on some other patches so haven't started updating the proposal yet. Nothing more to do on your side 🙂 |
BethGriggs commented Feb 4, 2021
Would appreciate a review on this before landing (maybe @nodejs/modules)? |
BethGriggs left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backport LGTM comparing with #36178
Signed-off-by: Ruben Bridgewater <[email protected]> Backport-PR-URL: #37100 PR-URL: #36178Fixes: #35730Fixes: #36151 Refs: #35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Signed-off-by: Ruben Bridgewater <[email protected]> Backport-PR-URL: #37100 PR-URL: #36178Fixes: #35730Fixes: #36151 Refs: #35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
BethGriggs commented Feb 5, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Landed in 408c7a65f3...f206505 (v14.x-staging). Thanks @Pezmc |
Signed-off-by: Ruben Bridgewater <[email protected]> Backport-PR-URL: #37100 PR-URL: #36178Fixes: #35730Fixes: #36151 Refs: #35754 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Guy Bedford <[email protected]> Reviewed-By: James M Snell <[email protected]>
Pezmc commented Feb 15, 2021
Landed in https://github.com/nodejs/node/releases/tag/v14.15.5! 💃 |
Backports #36178 from @BridgeAR, tagged as semver‑patch, to 14.x as per comment from @ExE-Boss
14.x is currently impacted by the bug fixed in #36178, which was originally released to 15.x in https://github.com/nodejs/node/releases/tag/v15.5.0
I followed the guide from https://github.com/nodejs/node/blob/master/doc/guides/backporting-to-release-lines.md