diff options
author | Marian Oancea <contact@siteshop.ro> | 2014-11-07 04:51:37 +0800 |
---|---|---|
committer | Marian Oancea <contact@siteshop.ro> | 2014-11-07 04:51:37 +0800 |
commit | 3270b432bcb007944e3b6e17329b062cb6b7da78 (patch) | |
tree | 197238043b4e4e7e5b20c2d985961e863fe52a92 /lib | |
parent | bd14b4d23e5eaaf5359b73a2744727df5624ab97 (diff) | |
download | dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar.gz dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar.bz2 dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar.lz dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar.xz dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.tar.zst dexon-3270b432bcb007944e3b6e17329b062cb6b7da78.zip |
Refactoring
Removed browser fixes
Updated gulp to bypass native browser objects
Added source map for dist
Diffstat (limited to 'lib')
-rw-r--r-- | lib/browser_fix/xhr.js | 35 | ||||
-rw-r--r-- | lib/httprpc.js | 5 | ||||
-rw-r--r-- | lib/index.js | 6 | ||||
-rw-r--r-- | lib/websocket.js | 5 |
4 files changed, 6 insertions, 45 deletions
diff --git a/lib/browser_fix/xhr.js b/lib/browser_fix/xhr.js deleted file mode 100644 index aeb9bfaf7..000000000 --- a/lib/browser_fix/xhr.js +++ /dev/null @@ -1,35 +0,0 @@ - -/** - * Module dependencies. - */ - -var global = (function() { return this; })(); // jshint ignore:line - -/** - * XMLHttpRequest constructor. - */ - -var XMLHttpRequest = window.XMLHttpRequest; // jshint ignore:line - -/** - * Module exports. - */ - -module.exports.XMLHttpRequest = XMLHttpRequest ? xhr : null; - -/** - * XMLHttpRequest constructor. - * - * @param {Object) opts (optional) - * @api public - */ - -function xhr(obj) { - var instance; - - instance = new XMLHttpRequest(obj); - - return instance; -} - -if (XMLHttpRequest) xhr.prototype = XMLHttpRequest.prototype; diff --git a/lib/httprpc.js b/lib/httprpc.js index 1968caa98..c1ee0f02a 100644 --- a/lib/httprpc.js +++ b/lib/httprpc.js @@ -21,8 +21,9 @@ * @date 2014 */ - -var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line +if(process.env.NODE_ENV !== "build") { + var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line +} var HttpRpcProvider = function (host) { diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 94a5a45e8..000000000 --- a/lib/index.js +++ /dev/null @@ -1,6 +0,0 @@ -var web3 = require('./main'); -web3.providers.WebSocketProvider = require('./websocket'); -web3.providers.HttpRpcProvider = require('./httprpc'); -web3.providers.QtProvider = require('./qt'); - -module.exports = web3;
\ No newline at end of file diff --git a/lib/websocket.js b/lib/websocket.js index 8ccb3d40b..93d58aeba 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -21,8 +21,9 @@ * @date 2014 */ -var WebSocket = require('ws'); // jshint ignore:line - +if(process.env.NODE_ENV !== "build") { + var WebSocket = require('ws'); // jshint ignore:line +} var WebSocketProvider = function(host) { // onmessage handlers |