-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
module: fix crash when built-in module export a default
key
#51481
Conversation
Review requested:
|
Looking at this bug, it seems that assigning arbitrary keys to process.asdf = 'blah';
const processMod = await import('node:process');
console.log(processMod.asdf); // blah I would argue that this is still a bug even with this PR fix for the default crash. |
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.
Of course I approve the fix, just noting there is some wider inconsistency here.
Co-authored-by: Geoffrey Booth <webadmin@geoffreybooth.com>
Commit Queue failed- Loading data for nodejs/node/pull/51481 ✔ Done loading data for nodejs/node/pull/51481 ----------------------------------- PR info ------------------------------------ Title module: fix crash when built-in module export a `default` key (#51481) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch aduh95:process-default -> nodejs:main Labels lib / src, author ready, needs-ci Commits 2 - module: fix crash when built-in module export a `default` key - Update lib/internal/bootstrap/realm.js Committers 2 - Antoine du Hamel - GitHub PR-URL: https://github.com/nodejs/node/pull/51481 Fixes: https://github.com/nodejs/node/issues/51480 Reviewed-By: Chengzhong Wu Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/51481 Fixes: https://github.com/nodejs/node/issues/51480 Reviewed-By: Chengzhong Wu Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth -------------------------------------------------------------------------------- ⚠ Commits were pushed since the last approving review: ⚠ - Update lib/internal/bootstrap/realm.js ℹ This PR was created on Tue, 16 Jan 2024 00:18:21 GMT ✔ Approvals: 3 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/51481#pullrequestreview-1822478224 ✔ - Guy Bedford (@guybedford): https://github.com/nodejs/node/pull/51481#pullrequestreview-1822522624 ✔ - Geoffrey Booth (@GeoffreyBooth) (TSC): https://github.com/nodejs/node/pull/51481#pullrequestreview-1822572122 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-01-16T17:44:01Z: https://ci.nodejs.org/job/node-test-pull-request/56816/ - Querying data for job/node-test-pull-request/56816/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/7580563296 |
Commit Queue failed- Loading data for nodejs/node/pull/51481 ✔ Done loading data for nodejs/node/pull/51481 ----------------------------------- PR info ------------------------------------ Title module: fix crash when built-in module export a `default` key (#51481) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch aduh95:process-default -> nodejs:main Labels lib / src, author ready, needs-ci Commits 2 - module: fix crash when built-in module export a `default` key - Update lib/internal/bootstrap/realm.js Committers 2 - Antoine du Hamel - GitHub PR-URL: https://github.com/nodejs/node/pull/51481 Fixes: https://github.com/nodejs/node/issues/51480 Reviewed-By: Chengzhong Wu Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/51481 Fixes: https://github.com/nodejs/node/issues/51480 Reviewed-By: Chengzhong Wu Reviewed-By: Guy Bedford Reviewed-By: Geoffrey Booth -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 16 Jan 2024 00:18:21 GMT ✔ Approvals: 3 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/51481#pullrequestreview-1831785070 ✔ - Guy Bedford (@guybedford): https://github.com/nodejs/node/pull/51481#pullrequestreview-1822522624 ✔ - Geoffrey Booth (@GeoffreyBooth) (TSC): https://github.com/nodejs/node/pull/51481#pullrequestreview-1822572122 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2024-01-19T07:06:33Z: https://ci.nodejs.org/job/node-test-pull-request/56816/ - Querying data for job/node-test-pull-request/56816/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 51481 From https://github.com/nodejs/node * branch refs/pull/51481/merge -> FETCH_HEAD ✔ Fetched commits as eb4432c12c67..da6e2ca80b02 -------------------------------------------------------------------------------- [main d234630551] module: fix crash when built-in module export a `default` key Author: Antoine du Hamel Date: Tue Jan 16 01:17:29 2024 +0100 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-process-default.js [main 3376c26fbc] Update lib/internal/bootstrap/realm.js Author: Antoine du Hamel Date: Tue Jan 16 10:35:42 2024 +0100 1 file changed, 2 insertions(+), 1 deletion(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4)https://github.com/nodejs/node/actions/runs/7580926436 |
Landed in a772973 |
PR-URL: nodejs#51481 Fixes: nodejs#51480 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: nodejs#51481 Fixes: nodejs#51480 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: nodejs#51481 Fixes: nodejs#51480 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
PR-URL: nodejs#51481 Fixes: nodejs#51480 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Fixes: #51480