Skip to content

Commit

Permalink
πŸ› fix getStaticValue to handle bigint correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Aug 20, 2019
1 parent 531b16f commit c119e83
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/get-static-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const builtinNames = Object.freeze(
new Set([
"Array",
"ArrayBuffer",
"BigInt",
"BigInt64Array",
"BigUint64Array",
"Boolean",
"DataView",
"Date",
Expand Down Expand Up @@ -233,8 +236,8 @@ const operations = Object.freeze({

Literal(node) {
//istanbul ignore if : this is implementation-specific behavior.
if (node.regex != null && node.value == null) {
// It was a RegExp literal, but Node.js didn't support it.
if ((node.regex != null || node.bigint != null) && node.value == null) {
// It was a RegExp/BigInt literal, but Node.js didn't support it.
return null
}
return node
Expand Down

0 comments on commit c119e83

Please sign in to comment.