0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Parse the command line before initializing V8.

Doing it the other way around means that V8 won't pick
up command line switches like `--prof`.

Props to Joshua Kehn for reporting the issue and Jeff Fifield
for pointing out the cause.

Fixes #900.
Fixes #1217.
This commit is contained in:
Ben Noordhuis 2011-06-23 22:44:10 +02:00 committed by Ryan Dahl
parent 72e18d7f19
commit b74d119b34

View File

@ -2486,11 +2486,13 @@ void EmitExit(v8::Handle<v8::Object> process) {
int Start(int argc, char *argv[]) {
uv_init();
// This needs to run *before* V8::Initialize()
argv = Init(argc, argv);
v8::V8::Initialize();
v8::HandleScope handle_scope;
argv = Init(argc, argv);
// Create the one and only Context.
Persistent<v8::Context> context = v8::Context::New();
v8::Context::Scope context_scope(context);