Permalink
Browse files

Move evals to extension module.

  • Loading branch information...
1 parent ace2be8 commit 870aa3d97f65a58f80e8347c796f5ba685410462 @pquerna pquerna committed with ry Jul 14, 2010
Showing with 12 additions and 5 deletions.
  1. +0 −5 src/node.cc
  2. +1 −0 src/node_extensions.h
  3. +9 −0 src/node_script.cc
  4. +2 −0 src/node_script.h
View
@@ -1505,11 +1505,6 @@ static Handle<Value> 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.
@@ -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)
View
@@ -280,3 +280,12 @@ template <node::Script::EvalInputFlags iFlag,
return result == args.This() ? result : scope.Close(result);
}
+
+void node::InitEvals(Handle<Object> target) {
+ HandleScope scope;
+
+ node::Context::Initialize(target);
+ node::Script::Initialize(target);
+}
+
+NODE_MODULE(node_evals, node::InitEvals);
View
@@ -57,5 +57,7 @@ class Script : ObjectWrap {
};
+void InitEvals(v8::Handle<v8::Object> target);
+
} // namespace node
#endif // node_script_h

0 comments on commit 870aa3d

Please sign in to comment.