Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Move evals to extension module.
Browse files Browse the repository at this point in the history
  • Loading branch information
pquerna authored and ry committed Jul 14, 2010
1 parent ace2be8 commit 870aa3d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/node.cc
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/node_extensions.h
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions src/node_script.cc
Expand Up @@ -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);
2 changes: 2 additions & 0 deletions src/node_script.h
Expand Up @@ -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.