Skip to content

Commit

Permalink
Node issue nodejs#1140: Fix incorrect dispatch of vm.runInContext for…
Browse files Browse the repository at this point in the history
… argument "filename"
  • Loading branch information
amb26 committed Jun 2, 2011
1 parent 7dd22c2 commit fc83002
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_script.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) {
}

const int filename_index = sandbox_index +
(context_flag == newContext ? 1 : 0);
((context_flag == newContext || context_flag == userContext)? 1 : 0);

This comment has been minimized.

Copy link
@koichik

koichik Aug 15, 2011

I prefer below:

(context_flag == thisContext ? 0 : 1);
Local<String> filename = args.Length() > filename_index
? args[filename_index]->ToString()
: String::New("evalmachine.<anonymous>");
Expand Down

0 comments on commit fc83002

Please sign in to comment.