Permalink
Browse files

node.assert() was broken.

  • Loading branch information...
1 parent 063890b commit 6dd850aa16cb3161e1046840c204dba093e9f683 @ry ry committed Sep 8, 2009
Showing with 8 additions and 2 deletions.
  1. +6 −0 src/node.cc
  2. +2 −2 src/util.js
View
@@ -25,6 +25,8 @@
#include <list>
#include <map>
+#include <v8-debug.h>
+
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 = Context::New(NULL,
process_template->InstanceTemplate());
Context::Scope context_scope(context);
+
+
context->Global()->Set(String::NewSymbol("process"), context->Global());
Local<Object> node_obj = Load(argc, argv);
View
@@ -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.

0 comments on commit 6dd850a

Please sign in to comment.