mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
vm: fix incorrect dispatch of vm.runInContext for argument "filename"
Adds test case and documentation for vm.runInContext and vm.createContext. Fixes #1140.
This commit is contained in:
1 parent
72246d97a2
commit
c05936ca13
3 files changed
+52
-1
No files matched your search
+1
-1
@@ -308,7 +308,7 @@ Handle<Value> WrappedScript::EvalMachine(const Arguments& args) {
|
||||
}
|
||||
|
||||
const int filename_index = sandbox_index +
|
||||
(context_flag == newContext ? 1 : 0);
|
||||
(context_flag == thisContext? 0 : 1);
|
||||
Local<String> filename = args.Length() > filename_index
|
||||
? args[filename_index]->ToString()
|
||||
: String::New("evalmachine.<anonymous>");
|
||||
|
||||
Reference in new issue
Block a user