Skip to content

Move cover for void discards to more specific elements#9

Merged
rbuckton merged 1 commit intomainfrom
cover-discard
Jun 12, 2024
Merged

Move cover for void discards to more specific elements#9
rbuckton merged 1 commit intomainfrom
cover-discard

Conversation

@rbuckton
Copy link
Collaborator

This moves the cover for void discards in destructuring out of UnaryExpression and into more specific elements where it can only be present:

  • Array Elements
  • Property Definitions
  • Extractor "arguments"

This approach aligns with how CoverInitializedName is handled in Object Literals.

This should hopefully address the cover grammar ambiguity with how await void is parsed in conjunction with the cover grammar for await using.

This also addresses an issue where we inadvertently parsed an Initializer after void in some destructuring contexts.

Fixes #5

@github-actions
Copy link

github-actions bot commented May 30, 2024

A preview of this PR can be found at https://tc39.es/proposal-discard-binding/pr/9.

@rbuckton rbuckton requested a review from waldemarhorwat May 30, 2024 21:42
@rbuckton rbuckton mentioned this pull request Jun 3, 2024
@rbuckton
Copy link
Collaborator Author

rbuckton commented Jun 4, 2024

@waldemarhorwat, do you think you might have time to review this this week? I'd like to add Discards as a late agenda item, but only if this addresses your concerns.

@waldemarhorwat
Copy link

As far as I can tell, this seems to have fixed the void issue.

@rbuckton rbuckton merged commit 530b279 into main Jun 12, 2024
@rbuckton rbuckton deleted the cover-discard branch June 12, 2024 10:19
@rbuckton rbuckton mentioned this pull request Jun 15, 2024
rbuckton added a commit that referenced this pull request Oct 1, 2024
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.

Grammar conflicts with explicit resource management

2 participants