diff options
author | Herbert Vojčík <herby@mailbox.sk> | 2010-08-20 20:59:33 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-09-08 21:40:55 +0400 |
commit | 71651bf8b240c985129f16545ded0bd14f6cee93 (patch) | |
tree | 074d15a64f3572054ebde86be983a9039c4305c4 /src/node_script.cc | |
parent | 6789ab16d8a7507791a918b699cb4a4d2b8653a3 (diff) |
Make test-global work with NODE_MODULE_CONTEXTS.
Diffstat (limited to 'src/node_script.cc')
-rw-r--r-- | src/node_script.cc | 2 |
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); } } |