modules: fix browser compilation.
This commit is contained in:
parent
67a00bfe50
commit
354cf00158
@ -1,2 +1,2 @@
|
||||
// Empty module for browserify.
|
||||
exports.empty = true;
|
||||
exports.unsupported = true;
|
||||
|
||||
@ -14,7 +14,7 @@ var utils = require('../utils/utils');
|
||||
var co = require('../utils/co');
|
||||
var native = require('../utils/native').binding;
|
||||
var backend = require('./backend');
|
||||
var lazy = require('../utils/lazy')(require, exports);
|
||||
var lazy = utils.lazy(require, exports);
|
||||
|
||||
/**
|
||||
* @exports crypto
|
||||
|
||||
@ -11,7 +11,7 @@ var assert = require('assert');
|
||||
var elliptic = require('elliptic');
|
||||
var secp256k1 = elliptic.ec('secp256k1');
|
||||
var Signature = require('elliptic/lib/elliptic/ec/signature');
|
||||
var curve = elliptic.curve;
|
||||
var curve = secp256k1.curve;
|
||||
var BN = require('bn.js');
|
||||
|
||||
/**
|
||||
|
||||
@ -1946,6 +1946,9 @@ utils.U32 = function U32(num) {
|
||||
|
||||
utils.lazy = require('./lazy');
|
||||
|
||||
if (utils.lazy.unsupported)
|
||||
utils.lazy = function() { return utils.nop; };
|
||||
|
||||
/*
|
||||
* Expose other objects.
|
||||
*/
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
"./lib/http/server": "./browser/empty.js",
|
||||
"./lib/http/wallet": "./browser/empty.js",
|
||||
"./lib/utils/lazy": "./browser/empty.js",
|
||||
"./lib/crypto/native": "./lib/crypto/empty.js",
|
||||
"./lib/utils/native": "./browser/empty.js",
|
||||
"./lib/utils/nfkd": "./lib/utils/nfkd-browser.js",
|
||||
"./lib/utils/nexttick": "./lib/utils/nexttick-browser.js",
|
||||
"./lib/crypto/backend": "./lib/crypto/backend-browser.js",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user