node/test/fixtures
Joyee Cheung 2531185423
module: allow cycles in require() in the CJS handling in ESM loader
When --import is used, the ESM loader is used to handle even pure
CJS entry points, and it can run into CJS module facades in the
evaluating state when the parent CJS module is being evaluated.
In this case it should be allowed, since the ESM <-> CJS cycles
that are meant to be disallowed (for the time being) should
already be detected before evaluation and wouldn't get here,
and CJS <-> CJS cycles are fine.

PR-URL: https://github.com/nodejs/node/pull/58598
Backport-PR-URL: https://github.com/nodejs/node/pull/59504
Fixes: https://github.com/nodejs/node/issues/58515
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Refs: https://github.com/nodejs/node/issues/52697
2025-08-27 19:20:44 +02:00
..
0-dns doc: normalize Bash code block info strings 2020-05-25 19:08:45 +02:00
apilinks
b
clustered-server lib,src: update cluster to use Parent 2021-01-05 15:41:45 -05:00
console lib: support FORCE_COLOR for non TTY streams 2023-05-30 11:36:14 +02:00
copy test: add test that uses multibyte for path and resolves modules 2025-03-06 13:38:16 +01:00
crypto crypto: use WebIDL converters in WebCryptoAPI 2023-01-17 08:57:58 +00:00
cycles module: do not check circular dependencies for exported proxies 2020-05-15 01:55:28 +02:00
debugger debugger: add a command to set which lines to check for context 2023-03-12 04:47:18 +00:00
dotenv util: fix parseEnv incorrectly splitting multiple ‘=‘ in value 2025-08-27 19:20:40 +02:00
errors src: fix undefined script name in error source 2025-03-06 13:38:08 +01:00
es-module-loaders module: unflag --experimental-require-module 2025-02-11 11:56:31 +01:00
es-module-require-cache esm: bypass CJS loader in default load under --default-type=module 2023-12-11 17:50:18 +00:00
es-module-shadow-realm module: bootstrap module loaders in shadow realm 2024-01-09 08:23:01 +00:00
es-module-specifiers esm: remove specifier resolution flag 2022-10-04 09:44:08 +00:00
es-module-url
es-modules module: handle instantiated async module jobs in require(esm) 2025-08-27 19:20:44 +02:00
eval test: migrate message eval tests from Python to JS 2025-03-06 13:38:04 +01:00
GH-7131
global
import-require-cycle module: allow cycles in require() in the CJS handling in ESM loader 2025-08-27 19:20:44 +02:00
inspector-instrumentation-breakpoint test: add Debugger.setInstrumentationBreakpoint known issue 2024-06-17 16:25:22 +02:00
internal-modules
json-with-directory-name-module
keys test: fix test-tls-client-mindhsize for OpenSSL32 2024-10-02 16:04:15 +02:00
macos-app-sandbox src: tolerate EPERM returned from tcsetattr 2020-06-25 10:56:34 -07:00
module-extension-over-directory
module-load-order
module-mocking test_runner: make mock_loader not confuse CJS and ESM resolution 2024-10-02 07:57:27 +02:00
module-require module: fix bad require.resolve with option paths for . and .. 2025-03-06 13:38:16 +01:00
module-require-symlink
nested-index
node_modules module: support 'module.exports' interop export in require(esm) 2025-02-11 11:56:34 +01:00
openssl3-conf crypto: avoid hang when no algorithm available 2023-01-19 17:31:08 +00:00
package-main-enoent doc: update default branch name in test/** 2022-06-17 10:49:22 +02:00
packages
permission permission: ignore internalModuleStat on module loading 2025-08-27 19:20:13 +02:00
policy policy: use tamper-proof integrity check function 2023-10-12 10:11:46 -03:00
policy-manifest policy: handle Module.constructor and main.extensions bypass 2023-08-09 10:20:33 -03:00
postject-copy deps,test: update postject to 1.0.0-alpha.6 2023-05-30 11:36:17 +02:00
repl-folder-extensions/foo.js
require-bin
require-empty-main
resolve-paths
sea sea: support sea.getRawAsset() 2024-03-25 19:25:52 +00:00
self_ref_module module: self referential modules in repl or -r 2020-07-23 07:50:01 -07:00
snapshot lib: account for cwd access from snapshot serialization cb 2024-03-25 19:28:19 +00:00
source-map lib: allow CJS source map cache to be reclaimed 2025-02-11 11:55:55 +01:00
syntax lib: fix checking syntax of esm module 2021-12-19 23:33:34 +00:00
test426 test: add initial test426 coverage 2025-03-06 13:38:06 +01:00
test-init-index
test-init-native
test-module-loading-globalpaths
test-repl-tab-completion
test-runner test_runner: simplify hook running logic 2025-01-24 22:18:45 +01:00
tools/checkimports tools: fix check-imports.py to match on word boundaries 2020-05-28 10:02:46 -04:00
uncaught-exceptions
v8 test: migrate message v8 tests from Python to JS 2023-12-11 17:50:32 +00:00
v8-coverage test_runner: omit inaccessible files from coverage 2023-05-12 11:57:21 +02:00
vm test: migrate message tests to use assertSnapshot 2023-05-12 11:56:58 +02:00
warning_node_modules src: implement IsInsideNodeModules() in C++ 2025-02-11 11:56:43 +01:00
wasi
watch-mode test: use tmpdir.resolve() 2023-09-10 18:07:39 +00:00
workload v8: add setHeapSnapshotNearHeapLimit 2022-09-08 09:33:20 +00:00
wpt test: update WPT for WebCryptoAPI to edd42c005c 2025-06-11 09:21:24 +02:00
x509-escaping tls: fix handling of x509 subject and issuer 2022-01-10 22:38:05 +00:00
.empty-hidden-repl-history-file
.empty-repl-history-file
.node_repl_history
a.js
aead-vectors.js
altdocs.md
assert-first-line.js
assert-long-line.js
async-error.js
baz.js
catch-stdout-error.js
child_process_should_emit_error.js
child-process-echo-options.js
child-process-message-and-exit.js
child-process-persistent.js
child-process-spawn-node.js
child-process-stay-alive-forever.js child_process: support AbortSignal in fork 2020-12-24 20:33:15 +00:00
cjs-module-wrap.js
cjs-module-wrapper.js
cluster-preload-test.js lib,src: update cluster to use Parent 2021-01-05 15:41:45 -05:00
cluster-preload.js lib,src: update cluster to use Parent 2021-01-05 15:41:45 -05:00
crash.wasm lib,src: use Response URL as WebAssembly location 2022-04-25 22:46:42 +01:00
crash.wat lib,src: use Response URL as WebAssembly location 2022-04-25 22:46:42 +01:00
debugger-repeat-last.js
debugger-util-regression-fixture.js
define-global.js
deprecated-userland-class.js
deprecated-userland-function.js
deprecated-userland-subclass.js
deprecated.js
destroy-stdin.js
disable-warning-worker.js src: add --disable-warning option 2023-12-19 16:17:47 +00:00
disable-warning.js src: add --disable-warning option 2023-12-19 16:17:47 +00:00
doc_inc_1.md
doc_inc_2.md
doc_with_backticks_in_headings.md doc: use _Static method_ instead of _Class Method_ 2020-08-09 07:02:28 -07:00
doc_with_yaml.md
document_with_cjs_and_esm_code_snippet.md tools,doc: add support for several flavors of JS code snippets 2021-03-06 16:13:57 +01:00
document_with_esm_and_cjs_code_snippet.md tools,doc: add support for several flavors of JS code snippets 2021-03-06 16:13:57 +01:00
document_with_links.md
document_with_special_heading.md tools,doc: allow page titles to contain inline code 2020-09-03 06:36:03 -07:00
echo-close-check.js
echo.js
elipses.txt
empty-with-bom.txt
empty.cjs esm: do not call getSource when format is commonjs 2023-12-19 16:17:57 +00:00
empty.js
empty.json esm: add support for JSON import assertion 2021-11-03 20:06:55 -07:00
empty.txt
emptyframe.http2 http2: treat non-EOF empty frames like other invalid frames 2021-03-26 20:51:57 +01:00
exit.js
experimental.json
exports-function-with-param.js
external-repl-module.js
failcounter.js
failmustcall1.js
failmustcall2.js
file-to-read-with-bom.txt
file-to-read-without-bom.txt
fixture.ini
foo
gc.js test: add trace-gc flag test 2022-03-28 21:15:08 +01:00
GH-892-request.js
GH-1899-output.js
google_ssl_hello.bin
guess-hash-seed.js test: fix test-hash-seed for new V8 versions 2022-10-11 07:27:47 +02:00
inspector-global-function.mjs bootstrap: make CJS loader snapshotable 2022-12-16 12:44:14 +01:00
inspector-open.js inspector: allow opening inspector when NODE_V8_COVERAGE is set 2023-01-29 21:46:36 +00:00
intrinsic-mutation.js
invalid.json
is-object.js
ispreloading.js module: add isPreloading indicator 2020-11-30 08:26:46 -08:00
klass-with-fields.js lib: add options to the heap snapshot APIs 2022-11-08 16:19:54 +01:00
leakedGlobal.js
linux-perf-logger.js test: v8: Add test-linux-perf-logger test suite 2023-12-11 11:12:02 +00:00
linux-perf.js
loop.js
mime-whatwg-generated.js util: add MIME utilities (#21128) 2022-10-19 04:26:16 +02:00
mime-whatwg.js util: add MIME utilities (#21128) 2022-10-19 04:26:16 +02:00
module-loading-error.node
monkey-patch-run-main.js
net-fd-passing-receiver.js
no-wrapper.js
not-main-module.js
old-repl-history-file-faulty.json
old-repl-history-file-obj.json
openssl_fips_disabled.cnf src,deps,build,test: add OpenSSL config appname 2022-05-31 13:41:30 +02:00
openssl_fips_enabled.cnf src,deps,build,test: add OpenSSL config appname 2022-05-31 13:41:30 +02:00
order_of_end_tags_5873.md doc: use _Static method_ instead of _Class Method_ 2020-08-09 07:02:28 -07:00
out-of-bound.wasm src: handle wasm out of bound in osx will raise SIGBUS correctly 2023-07-03 10:35:41 -03:00
out-of-bound.wat src: handle wasm out of bound in osx will raise SIGBUS correctly 2023-07-03 10:35:41 -03:00
outside.txt
overwrite-config-preload-module.js process: make process.config read only 2022-09-10 22:00:23 +00:00
parent-process-nonpersistent-fork.js
parent-process-nonpersistent.js
path-resolve.js
path.js
person-large.jpg
person.jpg
person.jpg.br
person.jpg.gz
pkgexports.mjs module: support 'module.exports' interop export in require(esm) 2025-02-11 11:56:34 +01:00
print A.js
print-10-lines.js
print-chars-from-buffer.js
print-chars.js
print-delayed.js loader: use default loader as cascaded loader in the in loader worker 2023-05-02 09:34:02 +02:00
print-error-message.js esm: refactor esm tests out of test/message 2022-01-06 11:07:52 +00:00
print-intrinsic-mutation-name.js
printA.js
printB.js
printC.js
pseudo-multimember-gzip.gz
pseudo-multimember-gzip.z
pss-vectors.json
readfile_pipe_test.txt
recursive-a.cjs esm: fix loading of CJS modules from ESM 2023-09-07 09:15:49 -03:00
recursive-b.cjs esm: fix loading of CJS modules from ESM 2023-09-07 09:15:49 -03:00
recvfd.js
registerExt2.test
registerExt.hello.world
registerExt.test
repl-load-multiline-no-trailing-newline.js readline: fix issue with newline-less last line 2023-05-02 09:33:52 +02:00
repl-load-multiline.js
repl-pretty-stack.js
repl-tab-completion-nested-repls.js
report-oom.js test: split report OOM tests 2022-08-29 11:39:15 +08:00
require-resolve.js module: make CJS load from ESM loader 2023-08-17 08:36:00 -03:00
rsa-oaep-test-vectors.js
sample_document.md
sample.png
sea.js src: refactor embedded entrypoint loading 2025-02-11 11:56:00 +01:00
semicolon.js
shared-memory.wasm
shared-memory.wat
should_exit.js
simple.wasm
simple.wat
spawn_closed_stdio.py
spawn-worker-with-copied-env.js test: skip --title check on IBM i 2024-08-19 10:32:45 +02:00
spawn-worker-with-trace-exit.js worker: allow copied NODE_OPTIONS in the env setting 2024-08-19 10:32:31 +02:00
test-error-first-line-offset.js
test-fs-readfile-error.js
test-fs-stat-sync-overflow.js
test-nodetiming-uvmetricsinfo.js src,lib: add performance.uvMetricsInfo 2024-10-02 07:57:45 +02:00
test-resolution-inspect-brk-main.ext
test-resolution-inspect-brk-resolver.js test: remove eslint-disable comment from fixture file 2021-07-10 21:52:36 -07:00
throws_error1.js
throws_error2.js
throws_error3.js
throws_error4.js
throws_error5.js
throws_error6.js
throws_error7.js
throws_error.js
tls-connect.js
tls-session-ticket.txt
tz-version.txt deps: update timezone to 2025b 2025-06-10 14:32:58 +02:00
url-idna.js
url-searchparams.js
url-setter-tests-additional.js
url-tests-additional.js
utf8_test_text.txt test: consolidate utf8 text fixtures in tests 2024-03-25 17:26:43 +00:00
utf8-bom-shebang-shebang.js
utf8-bom.js
utf8-bom.json
utf8-shebang-bom.js
warnings.js
wasi-preview-1.js test: split wasi tests 2024-03-25 19:27:16 +00:00
worker-data.cjs
worker-data.mjs
worker-from-argv.js
worker-name.js worker: add support for worker name in inspector and trace_events 2023-03-06 16:34:09 +00:00
worker-preload.js workers: fix spawning from preload scripts 2021-03-01 11:43:27 -08:00
worker-script.mjs
worker-script.ts test: add test to verify other extension can be loaded by worker 2021-08-26 13:14:06 -07:00
x1024.txt
x.txt