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

[parser] Disallow numeric separators in legacy octal like integers #10493

Merged
merged 4 commits into from Sep 24, 2019
Merged

[parser] Disallow numeric separators in legacy octal like integers #10493

merged 4 commits into from Sep 24, 2019

Conversation

zant
Copy link
Contributor

@zant zant commented Sep 24, 2019

Q                       A
Patch: Bug Fix? Yes, Spec compliance 👓
Major: Breaking Change? No
Tests Added + Pass? Yes
Any Dependency Changes? No
License MIT

The follow code should throw an error if the numeric separator plugin is enabled:

Input Code

00_0

Expected behavior/code
It should throw Invalid Invalid numeric separator after leading 0 error.

The Legacy Octal Like Decimal is defined as:

LegacyOctalLikeDecimalIntegerLiteral
0 OctalDigit
LegacyOctalLikeDecimalIntegerLiteral OctalDigit

OctalDigit
0 1 2 3 4 5 6 7

Reference

@babel-bot
Copy link
Collaborator

babel-bot commented Sep 24, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11702/

@nicolo-ribaudo nicolo-ribaudo added pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories Spec: Numeric Separator labels Sep 24, 2019
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zant
Copy link
Contributor Author

zant commented Sep 24, 2019

Thanks to you! Super glad to contribute :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Spec Compliance 👓 A type of pull request used for our changelog categories Spec: Numeric Separator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants