Skip to content

Commit

Permalink
fix: allow object literals without _isBignumber flag
Browse files Browse the repository at this point in the history
Fixes Rehydration after structural cloning MikeMcl#317.
  • Loading branch information
florianbepunkt committed Feb 2, 2022
1 parent 690d996 commit 9eb8fed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bignumber.js
Expand Up @@ -188,7 +188,7 @@

if (b == null) {

if (v && v._isBigNumber === true) {
if (v && typeof v.c !== "undefined" && typeof v.s !== "undefined" && typeof v.e !== "undefined") {
x.s = v.s;

if (!v.c || v.e > MAX_EXP) {
Expand Down
2 changes: 1 addition & 1 deletion bignumber.mjs
Expand Up @@ -185,7 +185,7 @@ function clone(configObject) {

if (b == null) {

if (v && v._isBigNumber === true) {
if (v && typeof v.c !== "undefined" && typeof v.s !== "undefined" && typeof v.e !== "undefined") {
x.s = v.s;

if (!v.c || v.e > MAX_EXP) {
Expand Down

0 comments on commit 9eb8fed

Please sign in to comment.