forked from github/cordova-android
updated bundled node_modules
This commit is contained in:
+19
-2
@@ -1038,14 +1038,31 @@ var bigInt = (function (undefined) {
|
||||
}
|
||||
var parseBase = function (text, base) {
|
||||
var length = text.length;
|
||||
var i;
|
||||
var absBase = Math.abs(base);
|
||||
for(var i = 0; i < length; i++) {
|
||||
var c = text[i].toLowerCase();
|
||||
if(c === "-") continue;
|
||||
if(/[a-z0-9]/.test(c)) {
|
||||
if(/[0-9]/.test(c) && +c >= absBase) {
|
||||
if(c === "1" && absBase === 1) continue;
|
||||
throw new Error(c + " is not a valid digit in base " + base + ".");
|
||||
} else if(c.charCodeAt(0) - 87 >= absBase) {
|
||||
throw new Error(c + " is not a valid digit in base " + base + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (2 <= base && base <= 36) {
|
||||
if (length <= LOG_MAX_INT / Math.log(base)) {
|
||||
var result = parseInt(text, base);
|
||||
if(isNaN(result)) {
|
||||
throw new Error(c + " is not a valid digit in base " + base + ".");
|
||||
}
|
||||
return new SmallInteger(parseInt(text, base));
|
||||
}
|
||||
}
|
||||
base = parseValue(base);
|
||||
var digits = [];
|
||||
var i;
|
||||
var isNegative = text[0] === "-";
|
||||
for (i = isNegative ? 1 : 0; i < text.length; i++) {
|
||||
var c = text[i].toLowerCase(),
|
||||
@@ -1227,7 +1244,7 @@ if (typeof module !== "undefined" && module.hasOwnProperty("exports")) {
|
||||
}
|
||||
|
||||
//amd check
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( "big-integer", [], function() {
|
||||
return bigInt;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user