diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2020-04-30 16:03:59 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2020-07-18 11:03:00 +0800 |
commit | f04538761f5bb3c334d3c8d16d093ac0916ff3bc (patch) | |
tree | e1cf92d0ed2faec507a3190f878beaa5799d483b /tools/snapshot | |
parent | ef9964f4c183f062ca25337984a542895590141d (diff) | |
download | node-new-f04538761f5bb3c334d3c8d16d093ac0916ff3bc.tar.gz |
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>
Diffstat (limited to 'tools/snapshot')
-rw-r--r-- | tools/snapshot/node_mksnapshot.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/snapshot/node_mksnapshot.cc b/tools/snapshot/node_mksnapshot.cc index 29f9e1cbcb..0ea2199008 100644 --- a/tools/snapshot/node_mksnapshot.cc +++ b/tools/snapshot/node_mksnapshot.cc @@ -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); |