diff options
author | Guy Bedford <guybedford@gmail.com> | 2017-10-11 15:45:21 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-10-21 10:45:40 -0700 |
commit | fe4675b301f0e3e26dcb88ef9f68fe35403330a0 (patch) | |
tree | 5857d5b4f56dc297dc5865fd311c5307ac80695a /test/es-module | |
parent | c4c63812822fc973cb3d4bb4040729213dcaa620 (diff) | |
download | android-node-v8-fe4675b301f0e3e26dcb88ef9f68fe35403330a0.tar.gz android-node-v8-fe4675b301f0e3e26dcb88ef9f68fe35403330a0.tar.bz2 android-node-v8-fe4675b301f0e3e26dcb88ef9f68fe35403330a0.zip |
module: fix main resolution and not found updates
This simplifies the top-level load when ES modules are enabled
as we can entirely delegate the module resolver, which will hand
over to CommonJS where appropriate.
All not found errors are made consistent to throw during resolve
and have the MODULE_NOT_FOUND code.
Includes the test case from https://github.com/nodejs/node/pull/15736.
Fixes: https://github.com/nodejs/node/issues/15732
PR-URL: https://github.com/nodejs/node/pull/16147
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test/es-module')
-rw-r--r-- | test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs | 3 | ||||
-rw-r--r-- | test/es-module/test-esm-preserve-symlinks-not-found.mjs | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs new file mode 100644 index 0000000000..bfeb71ef3a --- /dev/null +++ b/test/es-module/test-esm-preserve-symlinks-not-found-plain.mjs @@ -0,0 +1,3 @@ +// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs +/* eslint-disable required-modules */ +import './not-found.js'; diff --git a/test/es-module/test-esm-preserve-symlinks-not-found.mjs b/test/es-module/test-esm-preserve-symlinks-not-found.mjs new file mode 100644 index 0000000000..22c888028e --- /dev/null +++ b/test/es-module/test-esm-preserve-symlinks-not-found.mjs @@ -0,0 +1,3 @@ +// Flags: --experimental-modules --loader ./test/fixtures/es-module-loaders/not-found-assert-loader.mjs +/* eslint-disable required-modules */ +import './not-found'; |