Skip to content

Commit

Permalink
Parse the command line before initializing V8.
Browse files Browse the repository at this point in the history
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 nodejs#1217.
  • Loading branch information
bnoordhuis committed Jun 23, 2011
1 parent c95da94 commit b33dd7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2478,11 +2478,13 @@ void EmitExit(v8::Handle<v8::Object> process) {

int Start(int argc, char *argv[]) {
uv_init();
v8::V8::Initialize();
v8::HandleScope handle_scope;

// This needs to run *before* V8::Initialize()
argv = Init(argc, argv);

v8::V8::Initialize();
v8::HandleScope handle_scope;

// Create the one and only Context.
Persistent<v8::Context> context = v8::Context::New();
v8::Context::Scope context_scope(context);
Expand Down

0 comments on commit b33dd7c

Please sign in to comment.