Skip to content

lib: account for cwd access from snapshot serialization cb

Functions registered with addSerializeCallback() can access and call process.cwd(). b7d836e2 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

Merge request reports

Loading