Skip to content

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

Merged
nicolo-ribaudo merged 4 commits intobabel:masterfrom
zant:invalid-lol
Sep 24, 2019
Merged

[parser] Disallow numeric separators in legacy octal like integers#10493
nicolo-ribaudo merged 4 commits intobabel:masterfrom
zant:invalid-lol

Conversation

@zant
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants