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
StringNumericLiteral does not include NumericLiteralSeparator #10938
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, did you find this in a bug report outside of GitHub?
@nicolo-ribaudo Nope. I find it by searching Background: I was reviewing an estree AST design PR and inspired from
It is exactly how things are done in babel-parser, so I feel like there will be some potential bugs when a |
proposal-numeric-separator
incorrectly removes_
inNumber
argument.Number("4_2")
is never mentioned in the docs.The String Type Interpretation Grammar of
ToNumber
was updated in tc39/proposal-numeric-separator@fc53cdb, theStringNumericLiteral
does not allow a NumericLiteralSeparator. Therefore the following example should returnNaN
but Babel will transform
Number("4_2")
intoNumber("42")
, which is incorrect.This PR removes the transformation on
Number
arguments.