-
Notifications
You must be signed in to change notification settings - Fork 44
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 #93
Comments
Thanks for this info! This was done by some students of mine. Do you want to do a PR to solve it? |
Well, I was hoping that someone on the Meriyah team will fix it :-) |
cc/ @3cp Any insight in this issue? |
My PR didn't change the type BigIntLiteral to Literal. I will double check estree spec. |
Just want to be sure that the changes work. Note that the parser does different things depending if your giving a big number as a normal number or in hexadecimal. I think you may loose precision for hexadecimal. Please double check with the number given above. -Thomas |
Yes, your case is added into the unit tests. |
Thomas, the |
You're right it is a new interface, but the type does not change, like for regex literals: https://github.com/estree/estree/blob/d1cb85c0da029f905d3ef1930cec26d836f9d73f/es5.md#literal. They are also called Literal as type. If you try a bigint with Acorn on https://astexplorer.net/, then you will see it is also called Literal. |
I see, you are right. |
@neumatho pls try v3.0.0. |
@neumatho the v3.0.0 was shipped with wrong dist files. Pls try v3.0.1. |
That seems to work. |
Hi,
If you using a really big number in hexadecimal format, e.g. this one taken from your unit test 0x12300000000000000000000000000000000n, then the value of the Literal node only get the value of 9 instead of the real number, which is 99022168773993092867842010762644549533696.
I think it is because your doing a parseInt on a number that have exponential included.
The type of the node is also BigIntLiteral, which should only be Literal according to the specification.
-Thomas
The text was updated successfully, but these errors were encountered: