node/test/fixtures/snapshot
Joyee Cheung 33bbf3751b src: fixup Error.stackTraceLimit during snapshot building
When V8 creates a context for snapshot building, it does not
install Error.stackTraceLimit. As a result, error.stack would
be undefined in the snapshot builder script unless users
explicitly initialize Error.stackTraceLimit, which may be
surprising.

This patch initializes Error.stackTraceLimit based on the
value of --stack-trace-limit to prevent the surprise. If
users have modified Error.stackTraceLimit in the builder
script, the modified value would be restored during
deserialization. Otherwise, the fixed up limit would be
deleted since V8 expects to find it unset and re-initialize
it during snapshot deserialization.

PR-URL: https://github.com/nodejs/node/pull/55121
Fixes: https://github.com/nodejs/node/issues/55100
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-09-30 15:05:12 +00:00
..
check-marked.js test: add UMD module test with marked 2022-08-03 00:41:43 +08:00
check-mutate-fs.js
child-process-sync.js test: test syncrhnous methods of child_process in snapshot 2023-12-14 22:11:28 +01:00
console.js bootstrap: clean up inspector console methods during serialization 2022-09-07 11:20:40 +00:00
create-worker-and-vm.js src: add snapshot support for embedder API 2023-02-03 20:48:22 +00:00
cwd.js lib: account for cwd access from snapshot serialization cb 2024-02-29 20:55:00 +00:00
decompress-gzip-sync.js
dns-lookup.js dns: support dns module in the snapshot 2022-09-29 01:58:21 +08:00
dns-resolve.js dns: support dns module in the snapshot 2022-09-29 01:58:21 +08:00
echo-args.js src: add snapshot support for embedder API 2023-02-03 20:48:22 +00:00
error-stack.js src: fixup Error.stackTraceLimit during snapshot building 2024-09-30 15:05:12 +00:00
error.js
marked.js test: fix typos 2024-09-28 13:58:55 +00:00
mutate-error-stack-trace-limit.js src: fixup Error.stackTraceLimit during snapshot building 2024-09-30 15:05:12 +00:00
mutate-fs.js
server.js src: support diagnostics channel in the snapshot 2022-08-19 12:53:31 +08:00
ts-example.js test: test snapshotting TypeScript compiler 2022-08-03 00:41:45 +08:00
ts-example.ts test: test snapshotting TypeScript compiler 2022-08-03 00:41:45 +08:00
typescript-main.js test: test snapshotting TypeScript compiler 2022-08-03 00:41:45 +08:00
typescript.js doc: fix broken link to TC39 import attributes proposal 2023-05-13 13:36:31 +02:00
v8-startup-snapshot-api.js doc,test: update the v8.startupSnapshot doc and test the example 2023-05-03 13:14:56 +00:00
warning.js
weak-reference-gc.js lib: implement WeakReference on top of JS WeakRef 2023-08-16 18:45:07 +02:00
weak-reference.js lib: implement WeakReference on top of JS WeakRef 2023-08-16 18:45:07 +02:00
worker.js bootstrap: throw ERR_NOT_SUPPORTED_IN_SNAPSHOT in unsupported operation 2023-05-24 14:49:46 +02:00