node/test/fixtures/es-modules
Joyee Cheung f74beb53de
module: cache synchronous module jobs before linking
So that if there are circular dependencies in the synchronous
module graph, they could be resolved using the cached jobs.
In case linking fails and the error gets caught, reset the
cache right after linking. If it succeeds, the caller will
cache it again. Otherwise the error bubbles up to users,
and since we unset the cache for the unlinkable module
the next attempt would still fail.

PR-URL: https://github.com/nodejs/node/pull/52868
Fixes: https://github.com/nodejs/node/issues/52864
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-05-11 18:55:48 +02:00
..
cjs-esm-esm-cycle module: cache synchronous module jobs before linking 2024-05-11 18:55:48 +02:00
deprecated-folders-ignore module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
dynamic-import module: implement NODE_COMPILE_CACHE for automatic on-disk code caching 2024-04-29 22:46:25 +02:00
esm-cjs-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-cjs-esm-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-esm-cjs-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
esm-esm-cjs-esm-esm-cycle module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-04-08 14:45:55 +00:00
exports-both module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-import-default module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-import-only module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
exports-require-only module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
folder%25with percentage# esm: fix hint on invalid module specifier 2023-12-23 20:38:08 +00:00
json-cache
legacy-main-resolver src,lib: reducing C++ calls of esm legacy main resolve 2023-07-03 18:42:47 +00:00
module-counter-by-type loader: return package format from defaultResolve if known 2021-12-13 20:44:00 +00:00
package-cjs-named-error module: fix crash on multiline named cjs imports 2020-09-22 12:49:40 -04:00
package-default-extension module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
package-ends-node_modules src: do not treat all paths ending with node_modules as such 2023-12-25 11:44:26 +00:00
package-type-commonjs esm: bypass CJS loader in default load under --default-type=module 2023-11-10 09:20:46 +01:00
package-type-module esm: detect ESM syntax in ambiguous JavaScript 2023-10-20 15:44:56 +00:00
package-without-pjson loader: return package format from defaultResolve if known 2021-12-13 20:44:00 +00:00
package-without-type module: warn on detection in typeless package 2024-03-23 00:38:31 +00:00
pjson-invalid esm: better package.json parser errors 2020-09-11 05:09:44 -07:00
pjson-main
pkgimports module: fix segment deprecation for imports field 2022-10-13 07:31:31 -07:00
require-and-import module: fix submodules loaded by require() and import() 2024-04-29 22:46:24 +02:00
self-deprecated-folders module: runtime deprecate subpath folder mappings 2020-10-30 12:12:56 -04:00
tla module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
builtin-imports-case.mjs module: fix builtin reexport tracing 2020-10-04 10:30:13 -07:00
cjs-esm-esm.js esm: refine ERR_REQUIRE_ESM errors 2021-07-15 08:52:37 -07:00
cjs-esm.js module: fix ERR_REQUIRE_ESM error for null frames 2021-07-31 02:32:19 +00:00
cjs-exports-invalid.mjs module: refine module type mismatch error cases 2020-09-30 20:46:01 -07:00
cjs-exports.mjs deps: update to cjs-module-lexer@1.2.1 2021-04-30 14:43:48 +02:00
cjs-file.cjs
cjs.js
conditional-exports.js module: add warnings for experimental flags 2019-12-04 22:36:37 -05:00
conditional-exports.mjs module: expose exports conditions to loaders 2020-04-03 01:29:39 +02:00
data-import.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
dep1.js module: fix builtin reexport tracing 2020-10-04 10:30:13 -07:00
dep2.js module: fix builtin reexport tracing 2020-10-04 10:30:13 -07:00
es-note-error-1.cjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-1.mjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-2.cjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-2.mjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-3.cjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-3.mjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-4.cjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-error-4.mjs module: only try to enrich CJS syntax errors 2020-10-19 18:41:10 +00:00
es-note-promiserej-import-2.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-export-1.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-export-2.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-import-1.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-import-3.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-import-4.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
es-note-unexpected-import-5.cjs module: add warning when import,export is detected in CJS context 2019-08-13 11:19:48 -07:00
esm-snapshot-mutator.js
esm-snapshot.js
esm-top-level-await.mjs module: execute --import sequentially 2023-11-01 12:38:01 +00:00
export-name-code-injection.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-code-injection.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-syntax-error.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
export-name-syntax-error.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
exports-cases.js deps: update to cjs-module-lexer@1.2.1 2021-04-30 14:43:48 +02:00
exports-cases2.js module: named exports for CJS via static analysis 2020-09-28 18:27:25 -07:00
exports-cases3.js module: named exports for CJS via static analysis 2020-09-28 18:27:25 -07:00
file.ext esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
file.unknown esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
import-esm.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
import-invalid-ext.mjs esm: use correct error arguments 2019-05-20 10:26:23 -04:00
import-invalid-pjson.mjs esm: share package.json cache between ESM and CJS loaders 2020-05-24 16:22:31 -07:00
import-json-named-export.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
import-name.wasm module: fix code injection through export names 2023-10-13 18:03:52 -03:00
import-name.wat module: fix code injection through export names 2023-10-13 18:03:52 -03:00
import-process-exit.mjs
import-resolve-exports.mjs esm: move hook execution to separate thread 2023-04-13 09:35:17 +02:00
imported-esm.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
imports-loose.mjs esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
imports-noext.mjs esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
invalid-cjs.js module: refine module type mismatch error cases 2020-09-30 20:46:01 -07:00
invalid-posix-host.mjs esm: identify parent importing a url with invalid host 2023-09-23 05:41:26 +00:00
json-modules.mjs esm: use import attributes instead of import assertions 2023-10-14 03:52:38 +00:00
loop.mjs doc, lib, src, test, tools: fix assorted typos 2019-08-12 16:00:22 -07:00
loose.js esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
message.mjs
mjs-file.mjs
network-import.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
noext
noext-esm esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
noext-wasm esm: --experimental-default-type flag to flip module defaults 2023-09-29 06:18:44 +00:00
pattern-trailing-slash.mjs module: deprecate trailing slash pattern mappings 2021-09-14 23:58:56 -07:00
print-3.mjs esm: add --import flag 2022-07-31 04:08:02 +01:00
process-exit.mjs
reference-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-cjs.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-reference-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-syntax-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
require-throw-error.cjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
required-cjs.js module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
runmain.mjs esm: move hook execution to separate thread 2023-04-13 09:35:17 +02:00
should-not-be-resolved.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
simple.wasm esm: --experimental-wasm-modules integration support 2019-05-17 02:25:20 +02:00
simple.wat esm: --experimental-wasm-modules integration support 2019-05-17 02:25:20 +02:00
stateful.mjs esm: consolidate ESM loader hooks 2021-09-11 18:08:35 -07:00
symlink.mjs
syntax-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
test-esm-comma,.mjs lib: fix regular expression to detect / and \ 2021-10-21 14:55:00 +00:00
test-esm-double-encoding-native%20.mjs
test-esm-ok.mjs
throw-error.mjs module: support require()ing synchronous ESM graphs 2024-03-18 18:10:06 +08:00
wasm-dep.mjs esm: --experimental-wasm-modules integration support 2019-05-17 02:25:20 +02:00
wasm-modules.mjs module: add warnings for experimental flags 2019-12-04 22:36:37 -05:00