mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
node.assert() was broken.
This commit is contained in:
@@ -25,6 +25,8 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include <v8-debug.h>
|
||||||
|
|
||||||
using namespace v8;
|
using namespace v8;
|
||||||
using namespace node;
|
using namespace node;
|
||||||
|
|
||||||
@@ -382,10 +384,14 @@ main(int argc, char *argv[])
|
|||||||
// to it's namespace node.EventEmitter in Load() bellow.
|
// to it's namespace node.EventEmitter in Load() bellow.
|
||||||
EventEmitter::Initialize(process_template);
|
EventEmitter::Initialize(process_template);
|
||||||
|
|
||||||
|
Debug::EnableAgent("node", 2222);
|
||||||
|
|
||||||
Persistent<Context> context = Context::New(NULL,
|
Persistent<Context> context = Context::New(NULL,
|
||||||
process_template->InstanceTemplate());
|
process_template->InstanceTemplate());
|
||||||
Context::Scope context_scope(context);
|
Context::Scope context_scope(context);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
context->Global()->Set(String::NewSymbol("process"), context->Global());
|
context->Global()->Set(String::NewSymbol("process"), context->Global());
|
||||||
|
|
||||||
Local<Object> node_obj = Load(argc, argv);
|
Local<Object> node_obj = Load(argc, argv);
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ node.inherits = function (ctor, superCtor) {
|
|||||||
ctor.prototype.constructor = ctor;
|
ctor.prototype.constructor = ctor;
|
||||||
};
|
};
|
||||||
|
|
||||||
node.assert = function (x) {
|
node.assert = function (x, msg) {
|
||||||
if (!(x)) throw (msg || "assertion error");
|
if (!(x)) throw new Error(msg || "assertion error");
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is useful for dealing with raw encodings.
|
// This is useful for dealing with raw encodings.
|
||||||
|
|||||||
Reference in New Issue
Block a user