Use native assert

This commit is contained in:
Kagami Hiiragi 2014-12-20 13:48:12 +03:00
parent 2e9f064e7e
commit f366e4b0cc
4 changed files with 3 additions and 10 deletions

View File

@ -5,11 +5,11 @@
"use strict";
var assert = require("assert");
var bufferEqual = require("buffer-equal");
var bs58 = require("bs58");
var varint = require("./varint");
var bmcrypto = require("./crypto");
var assert = require("./utils").assert;
/**
* Parse Bitmessage Base58 encoded address (with or without `BM-`

View File

@ -10,9 +10,9 @@
"use strict";
var assert = require("assert");
require("es6-promise").polyfill();
var ripemd160 = require("ripemd160");
var assert = require("./utils").assert;
// Support `webkit` prefix for Safari (not tested yet).
// TODO(Kagami): Try to support IE11.

View File

@ -1,7 +0,0 @@
"use strict";
exports.assert = function(condition, message) {
if (!condition) {
throw new Error(message || "Assertion failed");
}
};

View File

@ -5,12 +5,12 @@
"use strict";
var assert = require("assert");
// TODO(Kagami): Since `node-int64` and `int64-native` APIs are slightly
// differ, there might be need in platform-dependent wrapper. Also think
// that to do with 64bit arithmetic since `node-int64` doesn't implement
// it.
var Int64 = require("int64-native");
var assert = require("./utils").assert;
exports.decode = function(buf) {
assert(buf.length > 0, "Empty buffer");