Allow null context in Script

This commit is contained in:
Ryan Dahl committed 2010-08-04 10:20:40 -07:00
1 parent 1a1214866f
commit 31b59400f8
2 files changed
+5 -1

No files matched your search

+1 -1
View File
@@ -175,7 +175,7 @@ template <node::Script::EvalInputFlags iFlag,
Local<Object> sandbox;
if (cFlag == newContext) {
sandbox = args.Length() > sbIndex ? args[sbIndex]->ToObject() : Object::New();
sandbox = args[sbIndex]->IsObject() ? args[sbIndex]->ToObject() : Object::New();
} else if (cFlag == userContext) {
sandbox = args[sbIndex]->ToObject();
}