From 870aa3d97f65a58f80e8347c796f5ba685410462 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Wed, 14 Jul 2010 00:17:21 -0700 Subject: [PATCH] Move evals to extension module. --- src/node.cc | 5 ----- src/node_extensions.h | 1 + src/node_script.cc | 9 +++++++++ src/node_script.h | 2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/node.cc b/src/node.cc index d36047c886..cd62b90224 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1505,11 +1505,6 @@ static Handle Binding(const Arguments& args) { exports = Object::New(); modp->register_func(exports); binding_cache->Set(module, exports); - } else if (!strcmp(*module_v, "evals")) { - exports = Object::New(); - node::Context::Initialize(exports); - node::Script::Initialize(exports); - binding_cache->Set(module, exports); } else if (!strcmp(*module_v, "natives")) { exports = Object::New(); // Explicitly define native sources. diff --git a/src/node_extensions.h b/src/node_extensions.h index 333756dfdb..5a6bc8654e 100644 --- a/src/node_extensions.h +++ b/src/node_extensions.h @@ -6,6 +6,7 @@ NODE_EXT_LIST_ITEM(node_child_process) #ifdef HAVE_OPENSSL NODE_EXT_LIST_ITEM(node_crypto) #endif +NODE_EXT_LIST_ITEM(node_evals) NODE_EXT_LIST_ITEM(node_fs) NODE_EXT_LIST_ITEM(node_net) NODE_EXT_LIST_ITEM(node_http_parser) diff --git a/src/node_script.cc b/src/node_script.cc index 2786cc002f..1e32b0f133 100644 --- a/src/node_script.cc +++ b/src/node_script.cc @@ -280,3 +280,12 @@ template target) { + HandleScope scope; + + node::Context::Initialize(target); + node::Script::Initialize(target); +} + +NODE_MODULE(node_evals, node::InitEvals); diff --git a/src/node_script.h b/src/node_script.h index ce65d5cff4..bd300459f5 100644 --- a/src/node_script.h +++ b/src/node_script.h @@ -57,5 +57,7 @@ class Script : ObjectWrap { }; +void InitEvals(v8::Handle target); + } // namespace node #endif // node_script_h