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

Move BindingPattern restriction for 'using' to an early error #145

Merged
merged 2 commits into from
Jan 31, 2023

Conversation

rbuckton
Copy link
Collaborator

@rbuckton rbuckton commented Jan 30, 2023

Per editor feedback in tc39/proposal-async-explicit-resource-management#9, this moves the BindingPattern restriction for using declarations to an Early Error to avoid ambiguity from using the Using parameter in two different ways. The early error condition is roughly equivalent to how const declarations report an early error on a missing Initializer.

@github-actions
Copy link

A preview of this PR can be found at https://tc39.es/proposal-explicit-resource-management/pr/145.

spec.emu Outdated
<emu-grammar>ForBinding : BindingPattern</emu-grammar>
<ul>
<li>
It is a Syntax Error if this |ForBinding| is contained in a |ForDeclaration| and IsUsingDeclaration of that |ForDeclaration| is *true*.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@michaelficarra: Is this sufficient to cover the case of a ForBinding contained in a `for` `(` `var` ForBinding ... production?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah that seems to work.

@rbuckton rbuckton merged commit 0f34893 into main Jan 31, 2023
@rbuckton rbuckton deleted the switch-to-early-errors branch January 31, 2023 19:01
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.

2 participants