0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-27 22:16:50 +01:00
nodejs/test/es-module
Joyee Cheung 8aac7da7d6
module: fix error thrown from require(esm) hitting TLA repeatedly
This tracks the asynchronicity in the ModuleWraps when they turn out to
contain TLA after instantiation, and throw the right error
(ERR_REQUIRE_ASYNC_MODULE) when it's required again. It removes
the freezing of ModuleWraps since it's not meaningful to freeze
this when the rest of the module loader is mutable, and we
can record the asynchronicity in the ModuleWrap right after
compilation after we get a V8 upgrade that contains
v8::Module::HasTopLevelAwait() instead of searching through
the module graph repeatedly which can be slow.

PR-URL: https://github.com/nodejs/node/pull/55520
Fixes: https://github.com/nodejs/node/issues/55516
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
2024-10-29 21:15:19 +00:00
..
es-module.status
test-cjs-esm-warn.js
test-cjs-legacyMainResolve-permission.js
test-cjs-legacyMainResolve.js
test-cjs-prototype-pollution.js
test-disable-require-module-with-detection.js
test-dynamic-import-script-lifetime.js
test-esm-assert-strict.mjs
test-esm-assertionless-json-import.js
test-esm-basic-imports.mjs
test-esm-child-process-fork-main.mjs
test-esm-cjs-builtins.js
test-esm-cjs-exports.js
test-esm-cjs-load-error-note.mjs
test-esm-cjs-main.js
test-esm-cjs-named-error.mjs
test-esm-custom-exports.mjs
test-esm-cyclic-dynamic-import.mjs
test-esm-data-urls.js
test-esm-default-type.mjs
test-esm-detect-ambiguous.mjs
test-esm-dns-promises.mjs
test-esm-double-encoding.mjs
test-esm-dynamic-import-attribute.js
test-esm-dynamic-import-attribute.mjs
test-esm-dynamic-import-commonjs.js
test-esm-dynamic-import-commonjs.mjs
test-esm-dynamic-import-mutating-fs.js
test-esm-dynamic-import-mutating-fs.mjs
test-esm-dynamic-import.js
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
test-esm-export-not-found.mjs
test-esm-exports-deprecations.mjs
test-esm-exports.mjs
test-esm-extension-lookup-deprecation.mjs
test-esm-extensionless-esm-and-wasm.mjs
test-esm-forbidden-globals.mjs
test-esm-fs-promises.mjs
test-esm-import-assertion-warning.mjs
test-esm-import-attributes-1.mjs
test-esm-import-attributes-2.mjs
test-esm-import-attributes-3.mjs
test-esm-import-attributes-errors.js
test-esm-import-attributes-errors.mjs
test-esm-import-attributes-validation.js
test-esm-import-flag.mjs
test-esm-import-json-named-export.mjs
test-esm-import-meta-resolve.mjs
test-esm-import-meta.mjs
test-esm-imports-deprecations.mjs
test-esm-imports.mjs
test-esm-initialization.mjs
test-esm-invalid-data-urls.js
test-esm-invalid-pjson.js
test-esm-json-cache.mjs
test-esm-json.mjs
test-esm-live-binding.mjs
test-esm-loader-cache-clearing.js
test-esm-loader-chaining.mjs
test-esm-loader-custom-condition.mjs
test-esm-loader-default-resolver.mjs
test-esm-loader-dependency.mjs
test-esm-loader-entry-url.mjs
test-esm-loader-event-loop.mjs
test-esm-loader-hooks.mjs
test-esm-loader-http-imports.mjs
test-esm-loader-invalid-format.mjs
test-esm-loader-invalid-url.mjs
test-esm-loader-mock.mjs
test-esm-loader-modulemap.js
test-esm-loader-not-found.mjs
test-esm-loader-programmatically.mjs
test-esm-loader-resolve-type.mjs
test-esm-loader-search.js
test-esm-loader-spawn-promisified.mjs
test-esm-loader-stringify-text.mjs
test-esm-loader-thenable.mjs
test-esm-loader-with-source.mjs
test-esm-loader-with-syntax-error.mjs
test-esm-loader.mjs
test-esm-long-path-win.js
test-esm-main-lookup.mjs
test-esm-module-not-found-commonjs-hint.mjs
test-esm-named-exports.mjs
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-esm-preserve-symlinks-main.js
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
test-esm-repl-imports.js
test-esm-repl.js
test-esm-require-cache.mjs
test-esm-resolve-type.mjs
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
test-esm-symlink-main.js
test-esm-symlink-type.js
test-esm-symlink.js
test-esm-syntax-error.mjs
test-esm-throw-undefined.mjs
test-esm-tla-unfinished.mjs
test-esm-tla.mjs
test-esm-type-field-errors-2.js
test-esm-type-field-errors.js
test-esm-type-field.mjs
test-esm-type-flag-cli-entry.mjs
test-esm-type-flag-errors.mjs
test-esm-type-flag-loose-files.mjs
test-esm-type-flag-package-scopes.mjs
test-esm-type-flag-string-input.mjs
test-esm-type-main.mjs
test-esm-undefined-cjs-global-like-variables.js
test-esm-unknown-extension.js
test-esm-url-extname.js
test-esm-util-types.mjs
test-esm-virtual-json.mjs
test-esm-wasm.mjs
test-esm-windows.js
test-import-module-conditional-exports-module.mjs
test-loaders-hidden-from-users.js
test-loaders-unknown-builtin-module.mjs
test-loaders-workers-spawned.mjs
test-require-as-esm-interop.mjs
test-require-module-cached-tla.js
test-require-module-conditional-exports-module.js
test-require-module-conditional-exports.js
test-require-module-cycle-cjs-esm-esm.js
test-require-module-cycle-esm-cjs-esm-esm.js
test-require-module-cycle-esm-cjs-esm.js
test-require-module-cycle-esm-esm-cjs-esm-esm.js
test-require-module-cycle-esm-esm-cjs-esm.js
test-require-module-default-extension.js
test-require-module-defined-esmodule.js
test-require-module-detect-entry-point-aou.js
test-require-module-detect-entry-point.js
test-require-module-dont-detect-cjs.js
test-require-module-dynamic-import-1.js
test-require-module-dynamic-import-2.js
test-require-module-dynamic-import-3.js
test-require-module-dynamic-import-4.js
test-require-module-errors.js
test-require-module-feature-detect.js
test-require-module-implicit.js
test-require-module-preload.js
test-require-module-retry-import-errored.js
test-require-module-retry-import-evaluating.js
test-require-module-tla-retry-import-2.js
test-require-module-tla-retry-import.js
test-require-module-tla-retry-require.js module: fix error thrown from require(esm) hitting TLA repeatedly 2024-10-29 21:15:19 +00:00
test-require-module-tla.js
test-require-module-transpiled.js
test-require-module-twice.js
test-require-module-warning.js
test-require-module-with-detection.js
test-require-module.js
test-typescript-commonjs.mjs
test-typescript-eval.mjs
test-typescript-module.mjs
test-typescript-transform.mjs
test-typescript.mjs
test-vm-compile-function-leak.js
test-vm-compile-function-lineoffset.js
test-vm-contextified-script-leak.js
test-vm-main-context-default-loader.js
test-vm-source-text-module-leak.js
test-vm-synthetic-module-leak.js
test-wasm-memory-out-of-bound.js
test-wasm-simple.js
test-wasm-web-api.js
testcfg.py