node/test/fixtures
Joyee Cheung 10099bb3f7
src: refactor embedded entrypoint loading
This patch:

1. Refactor the routines used to compile and run an embedder
  entrypoint. In JS land special handling for SEA is done
  directly in main/embedding.js instead of clobbering the CJS
  loader. Add warnings to remind users that currently the
  require() in SEA bundled scripts only supports loading builtins.
2. Don't use the bundled SEA code cache when compiling CJS
  loaded from disk, since in that case we are certainly not
  compiling the code bundled into the SEA. Use a is_sea_main
  flag in CompileFunctionForCJSLoader() (which replaces an unused
  argument) to pass this into the C++ land - the code cache is
  still read directly from C++ to avoid the overhead of
  ArrayBuffer creation.
3. Move SEA loading code into
  MaybeLoadSingleExecutableApplication() which calls
  LoadEnvironment() with its own StartExecutionCallback().
  This avoids more hidden switches in StartExecution() and
  make them explicit. Also add some TODOs about how to support
  ESM in embedded applications.
4. Add more comments

PR-URL: https://github.com/nodejs/node/pull/53573
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-07-05 19:58:35 +00:00
..
0-dns
apilinks
b
clustered-server
console lib: add diagnostics_channel events to module loading 2024-06-20 21:25:04 -03:00
copy/kitchen-sink
crypto crypto: use WebIDL converters in WebCryptoAPI 2023-01-17 08:57:58 +00:00
cycles
debugger debugger: add a command to set which lines to check for context 2023-03-12 04:47:18 +00:00
dotenv src: remove regex usage for env file parsing 2024-04-17 05:30:05 +00:00
errors lib: add diagnostics_channel events to module loading 2024-06-20 21:25:04 -03:00
es-module-loaders Revert "module: have a single hooks thread for all workers" 2024-06-02 22:10:34 +00:00
es-module-require-cache esm: bypass CJS loader in default load under --default-type=module 2023-11-10 09:20:46 +01:00
es-module-shadow-realm module: bootstrap module loaders in shadow realm 2023-11-13 22:09:47 +08:00
es-module-specifiers esm: remove specifier resolution flag 2022-10-04 09:44:08 +00:00
es-module-url
es-modules esm: move hooks test with others 2024-06-25 10:08:44 +00:00
GH-7131
global
inspector-instrumentation-breakpoint test: add Debugger.setInstrumentationBreakpoint known issue 2024-05-12 22:33:07 +02:00
internal-modules
json-with-directory-name-module
keys tls: fix order of setting cipher before setting cert and key 2023-11-16 14:40:37 +00:00
macos-app-sandbox
module-extension-over-directory
module-load-order
module-mocking test_runner: support module mocking 2024-05-19 05:09:09 +00:00
module-require
module-require-symlink
nested-index
node_modules esm: fix hint on invalid module specifier 2023-12-23 20:38:08 +00:00
openssl3-conf crypto: avoid hang when no algorithm available 2023-01-19 17:31:08 +00:00
package-main-enoent
packages
permission fs: move ToNamespacedPath to c++ 2024-06-20 02:11:10 +00:00
postject-copy deps,test: update postject to 1.0.0-alpha.6 2023-05-21 07:26:36 +00:00
repl-folder-extensions/foo.js
require-bin
require-empty-main
resolve-paths
run-script src: traverse parent folders while running --run 2024-06-07 21:20:52 +00:00
sea sea: support sea.getRawAsset() 2024-02-02 15:25:34 +01:00
self_ref_module
snapshot lib: account for cwd access from snapshot serialization cb 2024-02-29 20:55:00 +00:00
source-map timers: emit warning if delay is negative or NaN 2024-06-28 11:36:31 +00:00
syntax
test-init-index
test-init-native
test-module-loading-globalpaths
test-repl-tab-completion
test-runner test_runner: calculate executed lines using source map 2024-06-05 22:25:06 +00:00
tools/checkimports
uncaught-exceptions
v8 test: migrate message v8 tests from Python to JS 2023-10-29 05:55:01 +00:00
v8-coverage test_runner: omit inaccessible files from coverage 2023-05-10 14:08:00 +00:00
vm test: migrate message tests to use assertSnapshot 2023-04-27 06:41:58 +00:00
wasi
watch-mode test: use tmpdir.resolve() 2023-08-21 16:41:53 +00:00
workload
wpt test: update compression web-platform tests 2024-06-18 19:39:58 +00:00
x509-escaping
.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
cjs-module-wrap.js
cjs-module-wrapper.js
cluster-preload-test.js
cluster-preload.js
crash.wasm
crash.wat
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-11-21 20:30:02 +00:00
disable-warning.js src: add --disable-warning option 2023-11-21 20:30:02 +00:00
doc_inc_1.md
doc_inc_2.md
doc_with_backticks_in_headings.md
doc_with_yaml.md
document_with_cjs_and_esm_code_snippet.md
document_with_esm_and_cjs_code_snippet.md
document_with_links.md
document_with_special_heading.md
echo-close-check.js
echo.js
elipses.txt
empty-with-bom.txt
empty.cjs esm: do not call getSource when format is commonjs 2023-11-29 09:21:54 +00:00
empty.js
empty.json
empty.txt
emptyframe.http2
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
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
icu-punycode-toascii.json
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
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-10-25 23:37:54 +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
openssl_fips_enabled.cnf
order_of_end_tags_5873.md
out-of-bound.wasm src: handle wasm out of bound in osx will raise SIGBUS correctly 2023-06-12 14:50:21 +00:00
out-of-bound.wat src: handle wasm out of bound in osx will raise SIGBUS correctly 2023-06-12 14:50:21 +00:00
outside.txt
overwrite-config-preload-module.js
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
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-04-21 12:27:54 +00:00
print-error-message.js
print-intrinsic-mutation-name.js
printA.js
printB.js
printC.js
process-exit-code-cases.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-06 10:12:14 +00:00
recursive-b.cjs esm: fix loading of CJS modules from ESM 2023-09-06 10:12:14 +00: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-04-14 10:12:16 +00:00
repl-load-multiline.js
repl-pretty-stack.js
repl-tab-completion-nested-repls.js
report-oom.js
require-resolve.js module: make CJS load from ESM loader 2023-08-13 04:23:05 +00:00
rsa-oaep-test-vectors.js
sample_document.md
sample.png
sea.js src: refactor embedded entrypoint loading 2024-07-05 19:58:35 +00: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 worker: allow copied NODE_OPTIONS in the env setting 2024-07-05 18:40:03 +00:00
spawn-worker-with-trace-exit.js worker: allow copied NODE_OPTIONS in the env setting 2024-07-05 18:40:03 +00:00
test-error-first-line-offset.js
test-fs-readfile-error.js
test-fs-stat-sync-overflow.js
test-resolution-inspect-brk-main.ext
test-resolution-inspect-brk-resolver.js
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 Revert "util: move util._extend to eol" 2024-06-14 13:07:58 +00:00
tls-session-ticket.txt
tz-version.txt deps: update timezone to 2024a 2024-02-15 19:46:31 +00: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 2023-11-28 17:18:02 +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-02-24 17:55:27 +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
worker-script.mjs
worker-script.ts
x1024.txt
x.txt