Files
node/tools
Joyee Cheung 718f62bfcf bootstrap: unify snapshot builder and embedder entry points
- Run the embedder entry point directly through
  runEmbedderEntryPoint(), instead of going through another
  JS -> C++ trip through the function returned by
  getEmbedderEntryFunction()
- For --build-snapshot, read the snapshot script code directly in C++
  and pass it to SnapshotBuilder::Generate(), this makes the entry point
  more explicit instead of hiding it in JS land, and also makes it
  possible to invoke SnapshotBuilder::Generate() internally to create
  a custom snapshot.
- Previously we used process.execPath for the embedder to create
  __filename and __dirname in the snapshot builder script while using
  process.argv[1] for --build-snapshot (where it's always set) which
  results in inconsistencies. We now require the embedder to also set
  args[1] when creating the Environment if they intend to run snapshot
  scripts with a context that contains __filename and __dirname, which
  would be derived from args[1]. If they prefer not to include
  build-time paths in the snapshot, we now provide
  node::GetAnonymousMainPath() as an alternative.

PR-URL: https://github.com/nodejs/node/pull/48242
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-06-11 00:34:19 +02:00
..
2022-09-14 07:55:11 +00:00
2023-05-09 21:01:08 +00:00
2023-03-22 22:16:57 +00:00
2018-10-24 17:19:28 -04:00
2023-05-28 12:01:50 +00:00
2020-12-16 23:45:26 +01:00
2023-05-24 13:32:58 +02:00
2022-04-14 23:08:55 +01:00
2021-08-25 07:55:32 -07:00
2019-01-21 20:16:14 +01:00