Skip to content

Commit

Permalink
fix: check bigint in serializeToString and change it to string (#17931)
Browse files Browse the repository at this point in the history
  • Loading branch information
nutboltu committed Jan 31, 2020
1 parent 38cd758 commit d9a5170
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-devtools-shared/src/backend/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export function serializeToString(data: any): string {
}
cache.add(value);
}
// $FlowFixMe
if (typeof value === 'bigint') {
return value.toString() + 'n';
}
return value;
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const immutable = Immutable.fromJS({
xyz: 1,
},
});
// $FlowFixMe
const bigInt = BigInt(123); // eslint-disable-line no-undef

export default function UnserializableProps() {
return (
Expand All @@ -43,6 +45,7 @@ export default function UnserializableProps() {
setOfSets={setOfSets}
typedArray={typedArray}
immutable={immutable}
bigInt={bigInt}
/>
);
}
Expand Down

0 comments on commit d9a5170

Please sign in to comment.