Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigInt estree value is always null #8888

Open
mroch opened this issue May 30, 2022 · 1 comment
Open

BigInt estree value is always null #8888

mroch opened this issue May 30, 2022 · 1 comment

Comments

@mroch
Copy link
Contributor

mroch commented May 30, 2022

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:

node ?comments "BigIntLiteral" loc [("value", null); ("bigint", string raw)]

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.

@fisker
Copy link

fisker commented Feb 8, 2023

Should we change its type to Literal and add raw?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants