Skip to content

bootstrap: handle snapshot errors gracefully

This patch refactors the SnapshotBuilder::Generate() routines so that when running into errors during the snapshot building process, they can exit gracefully by printing the error and return a non-zero exit code. If the error is likely to be caused by internal scripts, the return code would be 12, if the error is caused by user scripts the return code would be 1. In addition this refactors the generation of embedded snapshots and directly writes to the output file stream instead of producing an intermediate string with string streams.

The first commit is from https://chromium-review.googlesource.com/c/v8/v8/+/3716682.

Refs: https://github.com/nodejs/node/issues/35711

Merge request reports

Loading