diff --git a/src/node.cc b/src/node.cc index 00554f8a4b..34f35bb5c3 100644 --- a/src/node.cc +++ b/src/node.cc @@ -25,6 +25,8 @@ #include #include +#include + using namespace v8; using namespace node; @@ -382,10 +384,14 @@ main(int argc, char *argv[]) // to it's namespace node.EventEmitter in Load() bellow. EventEmitter::Initialize(process_template); + Debug::EnableAgent("node", 2222); + Persistent context = Context::New(NULL, process_template->InstanceTemplate()); Context::Scope context_scope(context); + + context->Global()->Set(String::NewSymbol("process"), context->Global()); Local node_obj = Load(argc, argv); diff --git a/src/util.js b/src/util.js index a06c5f7103..f1ad501c2f 100644 --- a/src/util.js +++ b/src/util.js @@ -19,8 +19,8 @@ node.inherits = function (ctor, superCtor) { ctor.prototype.constructor = ctor; }; -node.assert = function (x) { - if (!(x)) throw (msg || "assertion error"); +node.assert = function (x, msg) { + if (!(x)) throw new Error(msg || "assertion error"); }; // This is useful for dealing with raw encodings.