Skip to content
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

[v8.x] lib: refactor ES module loader for readability #18085

Closed
wants to merge 3 commits into from

Conversation

addaleax
Copy link
Member

PR-URL: #16579

Only merge conflict was in errors.md

@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. v8.x labels Jan 10, 2018
@gibfahn
Copy link
Member

gibfahn commented Feb 18, 2018

Ran this locally and got:

make[1]: Leaving directory `/dev/shm/node/out'
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi
make -s build-addons
internal/loader/ModuleJob.js:1
(function (exports, require, module, __filename, __dirname) { 'use strict';
                                                              ^

ReferenceError: internalBinding is not defined
    at internal/loader/ModuleJob.js:1:63
    at NativeModule.compile (bootstrap_node.js:597:7)
    at NativeModule.require (bootstrap_node.js:542:18)
    at internal/loader/ModuleMap.js:3:19
    at NativeModule.compile (bootstrap_node.js:597:7)
    at NativeModule.require (bootstrap_node.js:542:18)
    at internal/loader/Loader.js:7:19
    at NativeModule.compile (bootstrap_node.js:597:7)
    at NativeModule.require (bootstrap_node.js:542:18)
    at module.js:45:16
/bin/sh: node: command not found
make[1]: *** [test/addons/.docbuildstamp] Error 127
make[1]: *** Waiting for unfinished jobs....
  touch 30580d6d8e368bd2d7a8507d249a0921e7c48fba.intermediate
  LD_LIBRARY_PATH=/dev/shm/node/out/Release/lib.host:/dev/shm/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src/inspector; mkdir -p /dev/shm/node/out/Release/obj/gen/src/inspector/protocol /dev/shm/node/out/Release/obj/gen/include/inspector; python ../../third_party/inspector_protocol/CodeGenerator.py --jinja_dir ../../third_party --output_base "/dev/shm/node/out/Release/obj/gen/src/inspector" --config inspector_protocol_config.json
make: *** [test] Error 2

CI to check: https://ci.nodejs.org/job/node-test-commit/16347/
https://ci.nodejs.org/job/node-test-commit/16361/

@gibfahn
Copy link
Member

gibfahn commented Mar 20, 2018

Rerun to check it's still not working: https://ci.nodejs.org/job/node-test-pull-request/13776/

Also ping @addaleax 😁

@devsnek devsnek mentioned this pull request Mar 20, 2018
3 tasks
@@ -1,91 +1,93 @@
'use strict';

const { ModuleWrap } = internalBinding('module_wrap');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be const { ModuleWrap } = require('internal/process').internalBinding('module_wrap');

@MylesBorins
Copy link
Member

ping @addaleax

@addaleax
Copy link
Member Author

sorry for dropping the ball on this, i’ll get to it as soon as i have time (which is the case for basically all my open prs – not that i don’t appreciate pings). if this is urgent for anybody, feel free to just push to this branch and kick off ci. i, however, am going to sleep now. night everyone!

@MylesBorins
Copy link
Member

@addaleax just pinging as a reflex, lmk if you would prefer I hold off on pinging you for a minute

@MylesBorins MylesBorins force-pushed the v8.x-staging branch 2 times, most recently from 44cb0d3 to 16bf5fe Compare March 30, 2018 03:28
@guybedford
Copy link
Contributor

guybedford commented Apr 4, 2018

I've pushed up the internalBinding fix here, and run a new CI job - https://ci.nodejs.org/job/node-test-pull-request/14040/.

Updated CI: https://ci.nodejs.org/job/node-test-pull-request/14136/

@guybedford
Copy link
Contributor

Note - CI here is now passing, although there seem to be some unrelated CI failures.

@gibfahn
Copy link
Member

gibfahn commented Apr 12, 2018

@gibfahn
Copy link
Member

gibfahn commented Apr 12, 2018

Just to check, this would be semver-major as it adds a new Error message, but ESM is still experimental. Is that correct?

gibfahn pushed a commit that referenced this pull request Apr 12, 2018
PR-URL: #16579
Backport-PR-URL: #18085
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented Apr 12, 2018

Landed in 2019b02

Thanks for fixing this up @guybedford !

@gibfahn gibfahn closed this Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
errors Issues and PRs related to JavaScript errors originated in Node.js core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants