-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
esm: fix loader hooks accepting too many arguments #44109
esm: fix loader hooks accepting too many arguments #44109
Conversation
Review requested:
cc @targos |
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.
Looks good to me. Github won't let me mark this review as "Approve" so I submitted it as "Comment" instead. I asked a question but it's not a blocker.
Noting for completeness: the code before this pull request also assumed 2 args, so this PR is not introducing an additional limitation or restriction; it was already like that. The switch-case did not check if |
account for prototype pollution in Array & Object
consolidate assignment & set arg0 default
validateArgs array → separate args
…arguments ReflectApply → direct invocation w separate args
Commit Queue failed- Loading data for nodejs/node/pull/44109 ✔ Done loading data for nodejs/node/pull/44109 ----------------------------------- PR info ------------------------------------ Title esm: fix loader hooks accepting too many arguments (#44109) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch JakobJingleheimer:fix/esm-loader-accepts-too-many-args -> nodejs:main Labels esm, needs-ci, loaders, commit-queue-squash Commits 7 - esm: fix loader hooks accepting too many arguments - fixup! esm: fix loader hooks accepting too many arguments - fixup! fixup! esm: fix loader hooks accepting too many arguments - fixup! fixup! fixup! esm: fix loader hooks accepting too many arguments - fixup! fixup! fixup! fixup! esm: fix loader hooks accepting too many … - improve substring match - correct context arg passed to nextHook fn Committers 1 - Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com> PR-URL: https://github.com/nodejs/node/pull/44109 Reviewed-By: Geoffrey Booth Reviewed-By: Guy Bedford Reviewed-By: Antoine du Hamel ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/44109 Reviewed-By: Geoffrey Booth Reviewed-By: Guy Bedford Reviewed-By: Antoine du Hamel -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 02 Aug 2022 20:24:18 GMT ✔ Approvals: 3 ✔ - Geoffrey Booth (@GeoffreyBooth) (TSC): https://github.com/nodejs/node/pull/44109#pullrequestreview-1061107695 ✔ - Guy Bedford (@guybedford): https://github.com/nodejs/node/pull/44109#pullrequestreview-1059598743 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/44109#pullrequestreview-1060885869 ✖ This PR needs to wait 11 more hours to land ✔ Last GitHub CI successful ℹ Last Full PR CI on 2022-08-04T05:28:44Z: https://ci.nodejs.org/job/node-test-pull-request/45830/ - Querying data for job/node-test-pull-request/45830/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/2795302869 |
Grr |
Landed in e0b440a |
PR-URL: #44109 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #44109 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #44109 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#44109 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs/node#44109 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
When a user supplies too many arguments, those beyond the 2nd arg are currently blindly passed to the
next<HookName>
function. Now, those extra args are ignored. It assumes bothresolve
andload
share the same number of args—which they currently do; if that changes, this will need to be updated.Fixes #44108