node/test/fixtures/snapshot
Anna Henningsen 40565e90b4
lib: account for cwd access from snapshot serialization cb
Functions registered with `addSerializeCallback()` can access and call
`process.cwd()`. b7d836e2c7 accounted for the fact that it is
necessary to reset the cwd cache after the snapshot builder script has
run, but did not account for possible accesses from serialization
callbacks. To properly account for these, add a deserialization
callback as well.

As a related drive-by fix, also mention the execution order of
callbacks in the documentation.

Refs: https://github.com/nodejs/node/pull/49684
PR-URL: https://github.com/nodejs/node/pull/51901
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-02-29 20:55:00 +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.js
marked.js test: add UMD module test with marked 2022-08-03 00:41:43 +08: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 bootstrap: clean up warning setup during serialization 2022-08-03 00:41:42 +08:00
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