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
check-mutate-fs.js
child-process-sync.js
console.js
create-worker-and-vm.js
cwd.js
decompress-gzip-sync.js
dns-lookup.js
dns-resolve.js
echo-args.js
error-stack.js
error.js
marked.js
mutate-error-stack-trace-limit.js
mutate-fs.js
server.js
ts-example.js
ts-example.ts
typescript-main.js
typescript.js
v8-startup-snapshot-api.js
warning.js
weak-reference-gc.js
weak-reference.js
worker.js