tools: enable Node.js command line flags in node_mksnapshot

Pass the flags down to node_mksnapshot so that we can use them
when generating the snapshot (e.g. to debug or enable V8 flags)

PR-URL: https://github.com/nodejs/node/pull/32984
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This commit is contained in:
Joyee Cheung committed 2020-07-18 11:03:00 +08:00
1 parent ef9964f4c1
commit f04538761f
1 file changed
+7 -1
+7 -1
View File
@@ -33,12 +33,18 @@ int main(int argc, char* argv[]) {
return 1;
}
// Windows needs conversion from wchar_t to char. See node_main.cc
#ifdef _WIN32
int node_argc = 1;
char argv0[] = "node";
char* node_argv[] = {argv0, nullptr};
node::InitializationResult result =
node::InitializeOncePerProcess(node_argc, node_argv);
#else
node::InitializationResult result =
node::InitializeOncePerProcess(argc, argv);
#endif
CHECK(!result.early_return);
CHECK_EQ(result.exit_code, 0);