Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move evals to extension module.

  • Loading branch information...
commit 870aa3d97f65a58f80e8347c796f5ba685410462 1 parent ace2be8
@pquerna pquerna authored ry committed
View
5 src/node.cc
@@ -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.
View
1  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)
View
9 src/node_script.cc
@@ -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
2  src/node_script.h
@@ -57,5 +57,7 @@ class Script : ObjectWrap {
};
+void InitEvals(v8::Handle<v8::Object> target);
+
} // namespace node
#endif // node_script_h
Please sign in to comment.
Something went wrong with that request. Please try again.