Browse Source

Move evals to extension module.

v0.7.4-release
Paul Querna 15 years ago
committed by Ryan Dahl
parent
commit
870aa3d97f
  1. 5
      src/node.cc
  2. 1
      src/node_extensions.h
  3. 9
      src/node_script.cc
  4. 2
      src/node_script.h

5
src/node.cc

@ -1505,11 +1505,6 @@ static Handle<Value> Binding(const Arguments& args) {
exports = Object::New(); exports = Object::New();
modp->register_func(exports); modp->register_func(exports);
binding_cache->Set(module, 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")) { } else if (!strcmp(*module_v, "natives")) {
exports = Object::New(); exports = Object::New();
// Explicitly define native sources. // Explicitly define native sources.

1
src/node_extensions.h

@ -6,6 +6,7 @@ NODE_EXT_LIST_ITEM(node_child_process)
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
NODE_EXT_LIST_ITEM(node_crypto) NODE_EXT_LIST_ITEM(node_crypto)
#endif #endif
NODE_EXT_LIST_ITEM(node_evals)
NODE_EXT_LIST_ITEM(node_fs) NODE_EXT_LIST_ITEM(node_fs)
NODE_EXT_LIST_ITEM(node_net) NODE_EXT_LIST_ITEM(node_net)
NODE_EXT_LIST_ITEM(node_http_parser) NODE_EXT_LIST_ITEM(node_http_parser)

9
src/node_script.cc

@ -280,3 +280,12 @@ template <node::Script::EvalInputFlags iFlag,
return result == args.This() ? result : scope.Close(result); 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
src/node_script.h

@ -57,5 +57,7 @@ class Script : ObjectWrap {
}; };
void InitEvals(v8::Handle<v8::Object> target);
} // namespace node } // namespace node
#endif // node_script_h #endif // node_script_h

Loading…
Cancel
Save