node/test/es-module
Shima Ryuhei 2a11d50526
module: correctly detect top-level await in ambiguous contexts
Fixes: https://github.com/nodejs/node/issues/58331
PR-URL: https://github.com/nodejs/node/pull/58646
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-11-19 18:17:40 +01:00
..
es-module.status test: skip test-http-imports on macos 2025-09-03 15:06:35 +02:00
test-cjs-esm-warn.js module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
test-cjs-legacyMainResolve-permission.js src,permission: add multiple allow-fs-* flags 2023-09-10 18:07:33 +00:00
test-cjs-legacyMainResolve.js lib: improve error message when index not found on cjs 2024-08-19 10:32:42 +02:00
test-cjs-prototype-pollution.js
test-disable-require-module-with-detection.js module: check --experimental-require-module separately from detection 2025-02-11 11:56:46 +01:00
test-dynamic-import-script-lifetime.js module: use symbol in WeakMap to manage host defined options 2023-09-28 15:28:23 -04:00
test-esm-assert-strict.mjs
test-esm-assertionless-json-import.js esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-basic-imports.mjs
test-esm-child-process-fork-main.mjs
test-esm-cjs-builtins.js
test-esm-cjs-exports.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-esm-cjs-load-error-note.mjs module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-esm-cjs-main.js
test-esm-cjs-named-error.mjs test: ensure never settling promises are detected 2023-12-11 11:11:46 +00:00
test-esm-custom-exports.mjs
test-esm-cyclic-dynamic-import.mjs
test-esm-data-urls.js esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-default-type.mjs
test-esm-detect-ambiguous.mjs module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
test-esm-dns-promises.mjs
test-esm-double-encoding.mjs
test-esm-dynamic-import-attribute.js esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-dynamic-import-attribute.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-dynamic-import-commonjs.js esm: do not call getSource when format is commonjs 2023-12-19 16:17:57 +00:00
test-esm-dynamic-import-commonjs.mjs esm: do not call getSource when format is commonjs 2023-12-19 16:17:57 +00:00
test-esm-dynamic-import-mutating-fs.js test,benchmark: use tmpdir.fileURL() 2023-09-10 18:07:39 +00:00
test-esm-dynamic-import-mutating-fs.mjs test,benchmark: use tmpdir.fileURL() 2023-09-10 18:07:39 +00:00
test-esm-dynamic-import.js vm: allow dynamic import with a referrer realm 2023-12-11 11:12:15 +00:00
test-esm-encoded-path-native.js
test-esm-encoded-path.mjs
test-esm-error-cache.js
test-esm-example-loader.mjs
test-esm-experimental-warnings.mjs esm: update loaders warning 2023-09-27 23:09:57 -04:00
test-esm-export-not-found.mjs
test-esm-exports-deprecations.mjs
test-esm-exports.mjs test: replace .substr with .slice 2024-07-19 15:26:51 +02:00
test-esm-extension-lookup-deprecation.mjs test: use tmpdir.resolve() 2023-09-10 18:07:39 +00:00
test-esm-extensionless-esm-and-wasm.mjs module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-esm-forbidden-globals.mjs
test-esm-fs-promises.mjs
test-esm-import-assertion-warning.mjs esm: fix inconsistency with importAssertion in resolve hook 2025-01-24 22:17:32 +01:00
test-esm-import-attributes-1.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-import-attributes-2.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-import-attributes-3.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-import-attributes-errors.js src: iterate on import attributes array correctly 2024-01-09 08:23:01 +00:00
test-esm-import-attributes-errors.mjs src: iterate on import attributes array correctly 2024-01-09 08:23:01 +00:00
test-esm-import-attributes-validation.js esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-import-flag.mjs module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-esm-import-json-named-export.mjs
test-esm-import-meta-resolve.mjs test: refactor some esm tests 2025-01-24 22:17:44 +01:00
test-esm-import-meta.mjs esm: add import.meta.dirname and import.meta.filename 2023-12-11 11:12:14 +00:00
test-esm-imports-deprecations.mjs
test-esm-imports.mjs test: replace .substr with .slice 2024-07-19 15:26:51 +02:00
test-esm-initialization.mjs test: fix es-module/test-esm-initialization 2023-08-17 08:35:56 -03:00
test-esm-invalid-data-urls.js lib: fix MIME overmatch in data URLs 2023-08-17 08:36:00 -03:00
test-esm-invalid-pjson.js
test-esm-json-cache.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-json.mjs esm: mark import attributes and JSON module as stable 2025-01-24 22:18:59 +01:00
test-esm-live-binding.mjs
test-esm-loader-cache-clearing.js
test-esm-loader-chaining.mjs esm: unflag Module.register and allow nested loader import() 2023-08-15 14:34:00 -03:00
test-esm-loader-custom-condition.mjs
test-esm-loader-default-resolver.mjs esm: identify parent importing a url with invalid host 2023-09-27 23:16:21 -04:00
test-esm-loader-dependency.mjs
test-esm-loader-event-loop.mjs
test-esm-loader-globalpreload-hook.mjs test: isolate globalPreload tests 2023-09-27 22:30:06 -04:00
test-esm-loader-hooks.mjs module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
test-esm-loader-http-imports.mjs
test-esm-loader-invalid-format.mjs
test-esm-loader-invalid-url.mjs
test-esm-loader-mock.mjs esm: refactor mocking test 2023-09-27 22:20:14 -04:00
test-esm-loader-modulemap.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-esm-loader-not-found.mjs
test-esm-loader-programmatically.mjs esm: add initialize hook, integrate with register 2023-08-17 08:35:57 -03:00
test-esm-loader-resolve-type.mjs test: use tmpdir.refresh() in test-esm-loader-resolve-type.mjs 2024-03-25 18:14:04 +00:00
test-esm-loader-search.js
test-esm-loader-side-effect.mjs
test-esm-loader-spawn-promisified.mjs module: prevent main thread exiting before esm worker ends 2025-01-24 22:18:54 +01:00
test-esm-loader-stringify-text.mjs
test-esm-loader-thenable.mjs
test-esm-loader-with-source.mjs esm: do not call getSource when format is commonjs 2023-12-19 16:17:57 +00:00
test-esm-loader-with-syntax-error.mjs
test-esm-loader.mjs esm: fix hook name in error message 2024-03-25 17:27:57 +00:00
test-esm-main-lookup.mjs esm: add a fallback when importer in not a file 2025-01-24 22:17:37 +01:00
test-esm-module-not-found-commonjs-hint.mjs esm: fix hint on invalid module specifier 2024-03-25 18:15:05 +00:00
test-esm-named-exports.mjs esm: refactor test-esm-named-exports 2023-09-27 22:20:16 -04:00
test-esm-namespace.mjs
test-esm-no-addons.mjs
test-esm-non-js.mjs
test-esm-nowarn-exports.mjs
test-esm-path-posix.mjs
test-esm-path-win32.mjs
test-esm-pkgname.mjs test: refactor some esm tests 2025-01-24 22:17:44 +01:00
test-esm-preserve-symlinks-main.js module: fix --preserve-symlinks-main 2024-03-25 19:24:09 +00:00
test-esm-preserve-symlinks-not-found-plain.mjs
test-esm-preserve-symlinks-not-found.mjs
test-esm-preserve-symlinks.js
test-esm-process.mjs
test-esm-prototype-pollution.mjs
test-esm-recursive-cjs-dependencies.mjs esm: fix loading of CJS modules from ESM 2023-09-07 09:15:49 -03:00
test-esm-repl-imports.js
test-esm-repl.js
test-esm-require-cache.mjs
test-esm-resolve-type.mjs module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-esm-scope-node-modules.mjs
test-esm-shared-loader-dep.mjs
test-esm-shebang.mjs
test-esm-snapshot.mjs
test-esm-source-map.mjs lib,src: extract sourceMappingURL from module 2024-03-25 19:27:39 +00:00
test-esm-symlink-main.js test: use tmpdir.resolve() 2023-09-10 18:07:39 +00:00
test-esm-symlink-type.js
test-esm-symlink.js
test-esm-syntax-error.mjs
test-esm-throw-undefined.mjs
test-esm-tla-syntax-errors-not-recognized-as-tla-error.mjs module: correctly detect top-level await in ambiguous contexts 2025-11-19 18:17:40 +01:00
test-esm-tla-unfinished.mjs
test-esm-tla.mjs
test-esm-type-field-errors-2.js module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
test-esm-type-field-errors.js module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
test-esm-type-field.mjs esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-esm-type-flag-cli-entry.mjs esm: fix hint on invalid module specifier 2024-03-25 18:15:05 +00:00
test-esm-type-flag-errors.mjs esm: bypass CJS loader in default load under --default-type=module 2023-12-11 17:50:18 +00:00
test-esm-type-flag-loose-files.mjs esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-esm-type-flag-package-scopes.mjs esm: unflag extensionless javascript and wasm in module scope 2023-11-11 19:39:38 +01:00
test-esm-type-flag-string-input.mjs esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-esm-type-main.mjs
test-esm-undefined-cjs-global-like-variables.js
test-esm-unknown-extension.js esm: unflag extensionless javascript and wasm in module scope 2023-11-11 19:39:38 +01:00
test-esm-url-extname.js esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-esm-util-types.mjs
test-esm-virtual-json.mjs esm: use import attributes instead of import assertions 2023-11-11 20:22:36 +01:00
test-esm-wasm.mjs module: fix code injection through export names 2023-10-12 10:11:46 -03:00
test-esm-windows.js test: use tmpdir.resolve() 2023-09-10 18:07:39 +00:00
test-http-imports-cli.mjs
test-http-imports.mjs lib,esm: handle bypass network-import via data: 2024-07-03 16:59:30 -03:00
test-import-module-conditional-exports-module.mjs module: implement the "module-sync" exports condition 2025-02-11 11:56:26 +01:00
test-import-module-retry-require-errored.js module: throw error when re-runing errored module jobs 2025-08-27 19:20:44 +02:00
test-import-preload-require-cycle.js module: allow cycles in require() in the CJS handling in ESM loader 2025-08-27 19:20:44 +02:00
test-loaders-hidden-from-users.js
test-loaders-unknown-builtin-module.mjs
test-loaders-workers-spawned.mjs test: make test-loaders-workers-spawned less flaky 2024-11-17 11:51:47 +01:00
test-require-as-esm-interop.mjs module: support 'module.exports' interop export in require(esm) 2025-02-11 11:56:34 +01:00
test-require-module-cached-tla.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-require-module-conditional-exports-module.js module: implement the "module-sync" exports condition 2025-02-11 11:56:26 +01:00
test-require-module-conditional-exports.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-require-module-cycle-cjs-esm-esm.js module: cache synchronous module jobs before linking 2025-02-11 11:55:49 +01:00
test-require-module-cycle-esm-cjs-esm-esm.js module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-08-08 15:02:56 +02:00
test-require-module-cycle-esm-cjs-esm.js module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-08-08 15:02:56 +02:00
test-require-module-cycle-esm-esm-cjs-esm-esm.js module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-08-08 15:02:56 +02:00
test-require-module-cycle-esm-esm-cjs-esm.js module: disallow CJS <-> ESM edges in a cycle from require(esm) 2024-08-08 15:02:56 +02:00
test-require-module-default-extension.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-defined-esmodule.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-detect-entry-point-aou.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-require-module-detect-entry-point.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-require-module-dont-detect-cjs.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-require-module-dynamic-import-1.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-dynamic-import-2.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-dynamic-import-3.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-dynamic-import-4.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-error-catching.js module: clarify cjs global-like error on ModuleJobSync 2025-08-27 19:20:44 +02:00
test-require-module-errors.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-require-module-feature-detect.js process: add process.features.require_module 2025-02-11 11:56:41 +01:00
test-require-module-implicit.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-require-module-instantiated.mjs module: handle instantiated async module jobs in require(esm) 2025-08-27 19:20:44 +02:00
test-require-module-preload.js module: only emit require(esm) warning under --trace-require-module 2025-02-11 11:57:01 +01:00
test-require-module-retry-import-errored-2.js module: throw error when re-runing errored module jobs 2025-08-27 19:20:44 +02:00
test-require-module-retry-import-errored.js module: allow ESM that failed to be required to be re-imported 2025-02-11 11:56:50 +01:00
test-require-module-retry-import-evaluating.js module: allow ESM that failed to be required to be re-imported 2025-02-11 11:56:50 +01:00
test-require-module-special-import.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-require-module-synchronous-rejection-handling.js module: mark evaluation rejection in require(esm) as handled 2025-02-11 11:56:59 +01:00
test-require-module-tla-execution.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-tla-nested.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-tla-print-execution.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-tla-rejected.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-tla-resolved.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-tla-retry-import-2.js module: allow ESM that failed to be required to be re-imported 2025-02-11 11:56:50 +01:00
test-require-module-tla-retry-import.js module: allow ESM that failed to be required to be re-imported 2025-02-11 11:56:50 +01:00
test-require-module-tla-retry-require.js module: fix error thrown from require(esm) hitting TLA repeatedly 2025-02-11 11:56:55 +01:00
test-require-module-tla-unresolved.js module: improve error message from asynchronicity in require(esm) 2025-08-27 19:20:43 +02:00
test-require-module-transpiled.js module: add __esModule to require()'d ESM 2025-02-11 11:56:02 +01:00
test-require-module-twice.js module: support require()ing synchronous ESM graphs 2024-08-08 15:02:48 +02:00
test-require-module-warning.js module: only emit require(esm) warning under --trace-require-module 2025-02-11 11:57:01 +01:00
test-require-module-with-detection.js module: unflag detect-module 2025-02-11 11:56:12 +01:00
test-require-module.js module: only emit require(esm) warning under --trace-require-module 2025-02-11 11:57:01 +01:00
test-require-node-modules-warning.js module: only emit require(esm) warning under --trace-require-module 2025-02-11 11:57:01 +01:00
test-vm-compile-function-leak.js test: use checkIfCollectable in vm leak tests 2023-09-28 15:28:24 -04:00
test-vm-compile-function-lineoffset.js lib: fix compileFunction throws range error for negative numbers 2023-11-11 19:56:03 +01:00
test-vm-contextified-script-leak.js test: deflake test-vm-contextified-script-leak 2023-09-28 15:28:24 -04:00
test-vm-main-context-default-loader.js vm: support using the default loader to handle dynamic import() 2024-03-25 19:26:26 +00:00
test-vm-source-text-module-leak.js v8: implement v8.queryObjects() for memory leak regression testing 2024-05-02 10:57:59 +02:00
test-vm-synthetic-module-leak.js test: use checkIfCollectable in vm leak tests 2023-09-28 15:28:24 -04:00
test-wasm-memory-out-of-bound.js esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-wasm-simple.js esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
test-wasm-web-api.js esm: --experimental-default-type flag to flip module defaults 2023-11-11 19:34:42 +01:00
testcfg.py