chore: bump node to v18.12.1 (main) (#36356)

* chore: bump node in DEPS to v18.12.1

* chore: update patches

* chore: add missing <algorithm> include

* src: add detailed embedder process initialization AP

https://github.com/nodejs/node/pull/44121

* chore: update gn build files

* dns: support dns module in the snapshot

https://github.com/nodejs/node/pull/44633

https://github.com/electron/electron/issues/36118

* src: fix OOB reads in process.title getter

https://github.com/nodejs/node/pull/31633

* chore: fix incorrectly removed patch bit

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
electron-roller[bot] 2022-11-21 10:55:01 -05:00 committed by GitHub
parent b71cccb0d6
commit c6d6af2551
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 390 additions and 343 deletions

View file

@ -141,12 +141,22 @@ int NodeMain(int argc, char* argv[]) {
if (flags_exit_code != 0)
exit(flags_exit_code);
node::InitializationSettingsFlags flags = node::kRunPlatformInit;
node::InitializationResult result =
node::InitializeOncePerProcess(argc, argv, flags);
// Hack around with the argv pointer. Used for process.title = "blah".
argv = uv_setup_args(argc, argv);
if (result.early_return)
exit(result.exit_code);
std::vector<std::string> args(argv, argv + argc);
std::unique_ptr<node::InitializationResult> result =
node::InitializeOncePerProcess(
args,
{node::ProcessInitializationFlags::kNoInitializeV8,
node::ProcessInitializationFlags::kNoInitializeNodeV8Platform});
for (const std::string& error : result->errors())
fprintf(stderr, "%s: %s\n", args[0].c_str(), error.c_str());
if (result->early_return() != 0) {
return result->exit_code();
}
gin::V8Initializer::LoadV8Snapshot(
gin::V8SnapshotFileType::kWithAdditionalContext);
@ -176,7 +186,7 @@ int NodeMain(int argc, char* argv[]) {
uint64_t env_flags = node::EnvironmentFlags::kDefaultFlags |
node::EnvironmentFlags::kHideConsoleWindows;
env = node::CreateEnvironment(
isolate_data, gin_env.context(), result.args, result.exec_args,
isolate_data, gin_env.context(), result->args(), result->exec_args(),
static_cast<node::EnvironmentFlags::Flags>(env_flags));
CHECK_NE(nullptr, env);