Skip to content

Commit c119e83

Browse files
committed
🐛 fix getStaticValue to handle bigint correctly
1 parent 531b16f commit c119e83

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: src/get-static-value.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const builtinNames = Object.freeze(
44
new Set([
55
"Array",
66
"ArrayBuffer",
7+
"BigInt",
8+
"BigInt64Array",
9+
"BigUint64Array",
710
"Boolean",
811
"DataView",
912
"Date",
@@ -233,8 +236,8 @@ const operations = Object.freeze({
233236

234237
Literal(node) {
235238
//istanbul ignore if : this is implementation-specific behavior.
236-
if (node.regex != null && node.value == null) {
237-
// It was a RegExp literal, but Node.js didn't support it.
239+
if ((node.regex != null || node.bigint != null) && node.value == null) {
240+
// It was a RegExp/BigInt literal, but Node.js didn't support it.
238241
return null
239242
}
240243
return node

0 commit comments

Comments
 (0)