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

Fix various parser idempotency issues and parsing errors #3917

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

raskad
Copy link
Member

@raskad raskad commented Jul 14, 2024

This PR fixes a bunch of parser idempotency issues, but also some parsing errors where our parser was behaving non spec compliant. I found all of the issues via the parser-idempotency fuzzer.

There are a lot of changes here regarding the names of function expressions and their handling via has_binding_identifier. Since there are some more issues with that, I plan to alter our current handling to fix those and align the handling more with the spec in a follow up to this.

It changes the following:

  • Fix cases where destructuring assignments would accept invalid assignment operators
  • Fix ArrayLiteral formatting
  • Prevent Literal::Undefined from being constructed by Arbitrary as it is only used for optimizations
  • Fix Literal::BigInt formatting
  • Remove tracking of excluded keys in object literals from ast and get them at compile time
  • Fix formatting for object literal methods
  • Fix Arbitrary implementation for TemplateLiteral
  • Fix formatting for unary expressions to always include a space between operator and target
  • Fix formatting of function expressions that do not have a binding identifier
  • Fix formatting of classes
  • Fix formatting of computed property names
  • Move handling of object literal function names to the compiler
  • Fix required check of semicolon at the end of a throw statement
  • Fix formatting of TaggedTemplate

@raskad raskad added bug Something isn't working parser Issues surrounding the parser ast Issue surrounding the abstract syntax tree labels Jul 14, 2024
@raskad raskad added this to the next-release milestone Jul 14, 2024
Copy link

github-actions bot commented Jul 14, 2024

Test262 conformance changes

Test result main count PR count difference
Total 48,212 48,212 0
Passed 43,264 43,264 0
Ignored 1,413 1,413 0
Failed 3,535 3,535 0
Panics 0 0 0
Conformance 89.74% 89.74% 0.00%

@raskad raskad force-pushed the fix-parser-idempotency branch from b2b8c91 to d81b511 Compare July 14, 2024 20:54
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

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

Nice work! Just needs a rebase :)

@HalidOdat HalidOdat requested a review from a team July 25, 2024 05:18
@raskad raskad force-pushed the fix-parser-idempotency branch from d81b511 to 41f35c2 Compare August 1, 2024 23:43
@raskad raskad added this pull request to the merge queue Aug 2, 2024
Merged via the queue into main with commit 3a6f4a5 Aug 2, 2024
13 checks passed
@raskad raskad deleted the fix-parser-idempotency branch August 2, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ast Issue surrounding the abstract syntax tree bug Something isn't working parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants