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

Add numeric separators support #725

Merged
merged 3 commits into from Jun 13, 2020

Conversation

tchetwin
Copy link
Contributor

@tchetwin tchetwin commented Jun 6, 2020

Adds support for Stage 3 Numeric Separators.
Numeric separators are available in V8, SpiderMonkey, JavaScriptCore and ChakraCore (see here).

Considerations:

  • As a stage 3 feature does this need special treatment, such as a flag?
    • I notice that class fields do not
  • How far should terser go to ensure parse-correctness? This currently "allows" the following, which could be caught with additional logic:
    • 1_e_1
    • 0_x_123

Fixes #632

Copy link
Contributor

@L2jLiga L2jLiga left a comment

Choose a reason for hiding this comment

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

I like it 😄

lib/parse.js Outdated Show resolved Hide resolved
lib/parse.js Show resolved Hide resolved
@fabiosantoscode fabiosantoscode merged commit ee965e8 into terser:master Jun 13, 2020
@fabiosantoscode
Copy link
Collaborator

Super cool! Thank you :)

Thanks to the reviewers as well :)

@tchetwin tchetwin deleted the numeric-separators branch June 14, 2020 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numeric Seperators are not supported
4 participants