-
Notifications
You must be signed in to change notification settings - Fork 782
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
ES2019 Feature: Numeric Separator #1989
Comments
yury-s
pushed a commit
to yury-s/webkit-http
that referenced
this issue
Aug 16, 2019
…eatures https://bugs.webkit.org/show_bug.cgi?id=200796 Reviewed by Ross Kirsling. Source/WebInspectorUI: Use a fork of Esprima to support modern JavaScript language features while going through the process to upstream support: ES2018 Feature: Async Iteration (for-await-of) jquery/esprima#1990 ES2019 Feature: Numeric Separator jquery/esprima#1989 ES2019 Feature: Optional catch binding jquery/esprima#1953 ES2020 Feature: BigInt jquery/esprima#1988 ESTree compatible AST changes are summarized as: - CatchClause `param` property is now nullable - ForOfStatement now has a boolean `await` property - Literal can be a `"bigint"` type (works if the environment has BigInt or not) The pretty printer only needed to have additional handling for `for-await-of`. * UserInterface/External/Esprima/esprima.js: New version. Typescript output expects a modern JavaScript environment instead of just ES6. * Tools/Formatting/index.html: Update the formatting tool for easier use in case of errors. * UserInterface/Models/ScriptSyntaxTree.js: (WI.ScriptSyntaxTree.prototype._createInternalSyntaxTree): * UserInterface/Test/TestHarness.js: (TestHarness.prototype.passOrFail): Convenience for pass/fail with the same message based on a condition. * UserInterface/Workers/Formatter/EsprimaFormatter.js: (EsprimaFormatter.prototype._handleTokenAtNode): Ensure a space after `await` in `for await` syntax. LayoutTests: * inspector/formatting/resources/javascript-tests/classes-expected.js: * inspector/formatting/resources/javascript-tests/classes.js: * inspector/formatting/resources/javascript-tests/for-statements-expected.js: * inspector/formatting/resources/javascript-tests/for-statements.js: * inspector/formatting/resources/javascript-tests/generators-expected.js: * inspector/formatting/resources/javascript-tests/generators.js: * inspector/formatting/resources/javascript-tests/numbers-expected.js: Added. * inspector/formatting/resources/javascript-tests/numbers.js: Added. * inspector/formatting/resources/javascript-tests/try-catch-finally-statements-expected.js: * inspector/formatting/resources/javascript-tests/try-catch-finally-statements.js: * inspector/formatting/resources/javascript-tests/unary-binary-expressions-expected.js: * inspector/formatting/resources/javascript-tests/unary-binary-expressions.js: Test formatting of new JavaScript language features. * inspector/formatting/formatting-css-expected.txt: * inspector/formatting/formatting-javascript-expected.txt: * inspector/formatting/formatting-javascript.html: * inspector/formatting/resources/utilities.js: (TestPage.registerInitializer.async.runFormattingTest): (TestPage.registerInitializer.window.addFormattingTests): (TestPage.registerInitializer): Cleaner output and better handling for debugging failures. * inspector/model/parse-script-syntax-tree.html: Test new AST permutations. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@248760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This is actually ES2021 feature instead of ES2019. See https://github.com/tc39/proposals/blob/master/finished-proposals.md |
I've created a pull for this in my fork: node-projects/esprima-next#12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Syntax:
New NumericLiteral syntax that allows for an
_
separator in numbers.Grammar changes are to NumericLiteral, allowing the
_
separator to show up in numbers.Spec:
TC39:
https://github.com/tc39/proposal-numeric-separator
https://tc39.es/proposal-numeric-separator/
ESTree:
No node changes proposed, numeric
Literal
nodevalue
will just be the valueAdditional considerations
BigInt
(ES2020 Feature: BigInt #1988)Remaining Tasks:
scanner.ts
changes for_
numeric separator)Test Cases
Valid:
Invalid:
The text was updated successfully, but these errors were encountered: