modules: fix browser compilation.

This commit is contained in:
Christopher Jeffrey 2016-11-18 23:17:29 -08:00
parent 67a00bfe50
commit 354cf00158
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
5 changed files with 7 additions and 4 deletions

View File

@ -1,2 +1,2 @@
// Empty module for browserify.
exports.empty = true;
exports.unsupported = true;

View File

@ -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

View File

@ -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');
/**

View File

@ -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.
*/

View File

@ -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",