You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this issue while fixing #46195. Looking at the explanation for the text property of LiteralLikeNode (link), it seems like it is actually working as intended. I'm not sure it’s always been like so since when this issue was opened, though.
I could argue that the property name text is confusing as one would expect it to be the node's textual representation in the source code.
TypeScript Version: 3.7.0-dev.20190907
Search Terms: numeric literal max value 9007199254740992 9007199254740993
Code
Expected behavior:
.text
should be the direct textual representation of the literal's value, right?Actual behavior:
...some kind of rounding behavior related to being above
Number.MAX_SAFE_INTEGER
?Playground Link: https://astexplorer.net/#/gist/8ee21b9bb7973f0d0118658496cec5ec/9dcea811268d39e678732414b53d608e37747a63 - since this is an AST parser issue
Related Issues: Discovered while writing a codefix for #29863. 😆
The text was updated successfully, but these errors were encountered: