Skip to content

Commit b74d119

Browse files
bnoordhuisry
authored andcommitted
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.
1 parent 72e18d7 commit b74d119

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/node.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,11 +2486,13 @@ void EmitExit(v8::Handle<v8::Object> process) {
24862486

24872487
int Start(int argc, char *argv[]) {
24882488
uv_init();
2489-
v8::V8::Initialize();
2490-
v8::HandleScope handle_scope;
24912489

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

2493+
v8::V8::Initialize();
2494+
v8::HandleScope handle_scope;
2495+
24942496
// Create the one and only Context.
24952497
Persistent<v8::Context> context = v8::Context::New();
24962498
v8::Context::Scope context_scope(context);

0 commit comments

Comments
 (0)