node/lib/internal/bootstrap
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
..
switches lib: account for cwd access from snapshot serialization cb 2024-02-29 20:55:00 +00:00
web lib: enable WebSocket by default 2024-02-04 14:03:39 +00:00
node.js src: add process.loadEnvFile and util.parseEnv 2024-01-23 18:46:26 +00:00
realm.js lib: only build the ESM facade for builtins when they are needed 2024-02-21 00:15:44 +01:00
shadow_realm.js module: bootstrap module loaders in shadow realm 2023-11-13 22:09:47 +08:00