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:
Antranig Basman authored and Ben Noordhuis committed 2011-08-16 14:50:04 +02:00
1 parent 72246d97a2
commit c05936ca13
3 files changed
+52 -1

No files matched your search

+1 -1
View File
@@ -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>");