Skip to content

Commit a02e97d

Browse files
committed
removed dependency on undefined global
1 parent 10d7441 commit a02e97d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

biginteger.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function BigInteger(n, s) {
8787
if (n instanceof BigInteger) {
8888
return n;
8989
}
90-
else if (n === undefined) {
90+
else if (typeof n === "undefined") {
9191
return BigInteger.ZERO;
9292
}
9393
return BigInteger.parse(n);
@@ -98,9 +98,6 @@ function BigInteger(n, s) {
9898
}
9999
this._d = n;
100100
this._s = n.length ? (s || 1) : 0;
101-
102-
// Keep editor from complaining about not returning
103-
return undefined;
104101
}
105102

106103
// Constant: ZERO
@@ -319,7 +316,7 @@ BigInteger.parse = function(s, base) {
319316
}
320317

321318
s = s.toString();
322-
if (base === undefined || +base === 10) {
319+
if (typeof base === "undefined" || +base === 10) {
323320
s = expandExponential(s);
324321
}
325322

@@ -329,7 +326,7 @@ BigInteger.parse = function(s, base) {
329326
var baseSection = parts[2] || "";
330327
var digits = parts[3] || "";
331328

332-
if (base === undefined) {
329+
if (typeof base === "undefined") {
333330
// Guess base
334331
if (baseSection === "0") { // Octal, or just 0
335332
if (digits.length === 0) {

0 commit comments

Comments
 (0)