flow
flow copied to clipboard
BigInt estree value is always `null`
Flow version: 0.179.0
Expected behavior
The value prop of a BigIntLiteral in ESTree should be a BigInt when using flow_parser.js in an environment that supports BigInt.
Actual behavior
we always return null:
https://github.com/facebook/flow/blob/c0050829cdb3f383445962dd93ae490fbdd28cf6/src/parser/estree_translator.ml#L1324
Fix
Translator_intf needs a method similar to regexp that returns null in most implementations, but JsTranslator tries to instantiate a BigInt in flow_parser_js.ml, wrapped in a try/with so it returns null if the JS runtime doesn't support it.
Should we change its type to Literal and add raw?