Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Vojčík <herby@mailbox.sk>2010-08-20 20:59:33 +0400
committerRyan Dahl <ry@tinyclouds.org>2010-09-08 21:40:55 +0400
commit71651bf8b240c985129f16545ded0bd14f6cee93 (patch)
tree074d15a64f3572054ebde86be983a9039c4305c4 /src/node_script.cc
parent6789ab16d8a7507791a918b699cb4a4d2b8653a3 (diff)
Make test-global work with NODE_MODULE_CONTEXTS.
Diffstat (limited to 'src/node_script.cc')
-rw-r--r--src/node_script.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_script.cc b/src/node_script.cc
index cbe8d12b5d2..d9631ec2f31 100644
--- a/src/node_script.cc
+++ b/src/node_script.cc
@@ -212,6 +212,7 @@ template <node::Script::EvalInputFlags iFlag,
for (i = 0; i < keys->Length(); i++) {
Handle<String> key = keys->Get(Integer::New(i))->ToString();
Handle<Value> value = sandbox->Get(key);
+ if (value == sandbox) { value = context->Global(); }
context->Global()->Set(key, value);
}
}
@@ -264,6 +265,7 @@ template <node::Script::EvalInputFlags iFlag,
for (i = 0; i < keys->Length(); i++) {
Handle<String> key = keys->Get(Integer::New(i))->ToString();
Handle<Value> value = context->Global()->Get(key);
+ if (value == context->Global()) { value = sandbox; }
sandbox->Set(key, value);
}
}