Skip to content

Commit 6c160ad

Browse files
committed
Merge pull request #21 from debris/master
fixed gulp build
2 parents 1954b87 + b6232cf commit 6c160ad

File tree

10 files changed

+27
-26
lines changed

10 files changed

+27
-26
lines changed

dist/ethereum.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethereum.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ethereum.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

lib/abi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var findMethodIndex = function (json, methodName) {
4646
};
4747

4848
var padLeft = function (string, chars) {
49-
return Array(chars - string.length + 1).join("0") + string;
49+
return new Array(chars - string.length + 1).join("0") + string;
5050
};
5151

5252
var setupInputTypes = function () {

lib/autoprovider.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@
2727
* if it fails, it uses HttpRpcProvider
2828
*/
2929

30-
// TODO: work out which of the following two lines it is supposed to be...
31-
//if (process.env.NODE_ENV !== 'build') {
32-
if ("build" !== 'build') {/*
30+
// TODO: is these line is supposed to be here?
31+
if (process.env.NODE_ENV !== 'build') {
3332
var WebSocket = require('ws'); // jshint ignore:line
3433
var web3 = require('./main.js'); // jshint ignore:line
35-
*/}
34+
}
3635

3736
var AutoProvider = function (userOptions) {
3837
if (web3.haveProvider()) {

lib/contract.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
* @date 2014
2121
*/
2222

23-
// TODO: work out which of the following two lines it is supposed to be...
24-
//if (process.env.NODE_ENV !== 'build') {
25-
if ("build" !== 'build') {/*
23+
// TODO: is these line is supposed to be here?
24+
if (process.env.NODE_ENV !== 'build') {
2625
var web3 = require('./web3'); // jshint ignore:line
27-
*/}
26+
}
27+
2828
var abi = require('./abi');
2929

3030
var contract = function (address, desc) {

lib/httprpc.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
* @date 2014
2222
*/
2323

24-
// TODO: work out which of the following two lines it is supposed to be...
25-
//if (process.env.NODE_ENV !== 'build') {
26-
if ("build" !== "build") {/*
24+
// TODO: is these line is supposed to be here?
25+
if (process.env.NODE_ENV !== 'build') {
2726
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
28-
*/}
27+
}
2928

3029
var HttpRpcProvider = function (host) {
3130
this.handlers = [];

lib/main.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ var web3 = {
272272
},
273273

274274
toEth: function(str) {
275-
var val = typeof str === "string" ? str.indexOf('0x') == 0 ? parseInt(str.substr(2), 16) : parseInt(str) : str;
275+
var val = typeof str === "string" ? str.indexOf('0x') === 0 ? parseInt(str.substr(2), 16) : parseInt(str) : str;
276276
var unit = 0;
277277
var units = [ 'wei', 'Kwei', 'Mwei', 'Gwei', 'szabo', 'finney', 'ether', 'grand', 'Mether', 'Gether', 'Tether', 'Pether', 'Eether', 'Zether', 'Yether', 'Nether', 'Dether', 'Vether', 'Uether' ];
278278
while (val > 3000 && unit < units.length - 1)
@@ -281,10 +281,14 @@ var web3 = {
281281
unit++;
282282
}
283283
var s = val.toString().length < val.toFixed(2).length ? val.toString() : val.toFixed(2);
284+
var replaceFunction = function($0, $1, $2) {
285+
return $1 + ',' + $2;
286+
};
287+
284288
while (true) {
285289
var o = s;
286-
s = s.replace(/(\d)(\d\d\d[\.\,])/, function($0, $1, $2) { return $1 + ',' + $2; });
287-
if (o == s)
290+
s = s.replace(/(\d)(\d\d\d[\.\,])/, replaceFunction);
291+
if (o === s)
288292
break;
289293
}
290294
return s + ' ' + units[unit];

lib/websocket.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222
* @date 2014
2323
*/
2424

25-
// TODO: work out which of the following two lines it is supposed to be...
26-
//if (process.env.NODE_ENV !== 'build') {
27-
if ("build" !== "build") {/*
25+
// TODO: is these line is supposed to be here?
26+
if (process.env.NODE_ENV !== 'build') {
2827
var WebSocket = require('ws'); // jshint ignore:line
29-
*/}
28+
}
3029

3130
var WebSocketProvider = function(host) {
3231
// onmessage handlers

0 commit comments

Comments
 (0)