Skip to content

Commit 55bd68c

Browse files
committed
Allow BigInts in strict mode
1 parent 2f0b910 commit 55bd68c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

big.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@
9898
x.c = n.c.slice();
9999
} else {
100100
if (typeof n !== 'string') {
101-
if (Big.strict === true) {
102-
throw TypeError(INVALID + 'number');
101+
if (Big.strict === true && typeof n !== 'bigint') {
102+
throw TypeError(INVALID + 'value');
103103
}
104104

105105
// Minus zero?

big.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ function _Big_() {
9595
x.c = n.c.slice();
9696
} else {
9797
if (typeof n !== 'string') {
98-
if (Big.strict === true) {
99-
throw TypeError(INVALID + 'number');
98+
if (Big.strict === true && typeof n !== 'bigint') {
99+
throw TypeError(INVALID + 'value');
100100
}
101101

102102
// Minus zero?

0 commit comments

Comments
 (0)