Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 2dcadc4

Browse files
committed
[Fixes #174] Remove methods polluting Array prototype
1 parent dc726b8 commit 2dcadc4

File tree

1 file changed

+24
-39
lines changed

1 file changed

+24
-39
lines changed

Diff for: js/main-unminified.js

+24-39
Original file line numberDiff line numberDiff line change
@@ -118796,26 +118796,6 @@
118796118796
}
118797118797
return output;
118798118798
}),
118799-
(Array.prototype.getUnique = function() {
118800-
for (var u = {}, a = [], i = 0, l = this.length; i < l; ++i)
118801-
u.hasOwnProperty(this[i]) ||
118802-
(a.push(this[i]), (u[this[i]] = 1));
118803-
return a;
118804-
}),
118805-
(Array.prototype.max = function() {
118806-
return Math.max.apply(null, this);
118807-
}),
118808-
(Array.prototype.min = function() {
118809-
return Math.min.apply(null, this);
118810-
}),
118811-
(Array.prototype.equals = function(b) {
118812-
if (this === b) return !0;
118813-
if (null == this || null == b) return !1;
118814-
if (this.length != b.length) return !1;
118815-
for (var i = 0; i < this.length; ++i)
118816-
if (this[i] !== b[i]) return !1;
118817-
return !0;
118818-
}),
118819118799
(Math.sign =
118820118800
Math.sign ||
118821118801
function(x) {
@@ -129403,25 +129383,30 @@
129403129383
);
129404129384
}),
129405129385
(self.initNetwork = function(callback) {
129406-
self.web3.version.getNetwork(function(error, version) {
129407-
error ||
129408-
!version ||
129409-
1 === Number(version) ||
129410-
self.config.ethTestnet ||
129411-
self.dialogError(
129412-
'You are connected to the Ethereum testnet. Please connect to the Ethereum mainnet.'
129413-
);
129414-
var ethGasPriceCookie = self.utility.readCookie(
129415-
'ethGasPrice'
129416-
);
129417-
if (ethGasPriceCookie) {
129418-
var newEthGasPrice = JSON.parse(ethGasPriceCookie);
129419-
newEthGasPrice > self.config.ethGasPrice
129420-
? self.setGasPrice(newEthGasPrice, !0)
129421-
: self.setGasPrice(self.config.ethGasPrice, !0);
129422-
} else self.setGasPrice(self.config.ethGasPrice, !0);
129423-
callback();
129424-
});
129386+
try {
129387+
self.web3.version.getNetwork(function(error, version) {
129388+
error ||
129389+
!version ||
129390+
1 === Number(version) ||
129391+
self.config.ethTestnet ||
129392+
self.dialogError(
129393+
'You are connected to the Ethereum testnet. Please connect to the Ethereum mainnet.'
129394+
);
129395+
var ethGasPriceCookie = self.utility.readCookie(
129396+
'ethGasPrice'
129397+
);
129398+
if (ethGasPriceCookie) {
129399+
var newEthGasPrice = JSON.parse(ethGasPriceCookie);
129400+
newEthGasPrice > self.config.ethGasPrice
129401+
? self.setGasPrice(newEthGasPrice, !0)
129402+
: self.setGasPrice(self.config.ethGasPrice, !0);
129403+
} else self.setGasPrice(self.config.ethGasPrice, !0);
129404+
callback();
129405+
});
129406+
} catch (err) {
129407+
console.error(err);
129408+
throw err;
129409+
}
129425129410
}),
129426129411
(self.initAPI = function(callback) {
129427129412
Array.isArray(self.config.socketServer) &&

0 commit comments

Comments
 (0)