Add bigint support to tryStaticEvaluation
MODIFY
packages/@romejs/js-ast-utils/tryStaticEvaluation.ts
packages/@romejs/js-ast-utils/tryStaticEvaluation.ts
@@ -8,7 +8,7 @@ import {Scope} from "@romejs/compiler";
import resolveIndirection from "./resolveIndirection";
export type EvalResult = {
- value: undefined | null | string | number | boolean;
+ value: undefined | null | bigint | string | number | boolean;
bailed: boolean;
};
@@ -178,6 +178,11 @@ export default function tryStaticEvaluation(
break;
}
+ case "JSBigIntLiteral": {
+ res = createResult(BigInt(node.value));
+ break;
+ }
+
case "JSStringLiteral":
case "JSBooleanLiteral":
case "JSNumericLiteral": {

Add bigint support to tryStaticEvaluation (#570)