-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
A preview of this PR can be found at https://tc39.es/proposal-async-explicit-resource-management/pr/15. |
This is a fairly early draft, but I'd like to get some feedback on the cover grammar. I'll continue to add some of the missing semantics rules needed to apply the supplemental syntax in later commits. |
I still need to review |
Here are some potential test cases for this grammar: await using is parsed as an ExpressionStatement containing an AwaitExpression (covered by CoverAwaitExpressionAndAwaitUsingDeclarationHead). await using
x = y is parsed as an ExpressionStatement containing an AwaitExpression (covered by CoverAwaitExpressionAndAwaitUsingDeclarationHead), followed by an ExpressionStatement containing an AssignmentExpression. await using x is a syntax error. CoverAwaitExpressionAndAwaitUsingDeclarationHead is parsed for await
using x is a syntax error. CoverAwaitExpressionAndAwaitUsingDeclarationHead is parsed for await
using
x is parsed as an ExpressionStatement containing an AwaitExpression (covered by CoverAwaitExpressionAndAwaitUsingDeclarationHead), followed by an ExpressionStatement containing an IdentifierReference. |
@waldemarhorwat: I'd appreciate if you're able to review sometime this week. |
@@ -2962,6 +3356,37 @@ contributors: Ron Buckton, Ecma International | |||
<emu-clause id="sec-async-function-definitions"> | |||
<h1>Async Function Definitions</h1> | |||
|
|||
<h2>Syntax</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a second definition of AsyncFunctionDeclaration pasted in the middle of the runtime semantics section? There already is a definition of AsyncFunctionDeclaration in the spec and I don't see the existing one being removed in this pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean by this. There are no <ins>
or <del>
tags in the grammar below, so no changes were made. I included the grammar here for reference as AwaitExpression
is referenced multiple times in the static semantics and runtime semantics.
Adds a cover grammar for
await using
.Fixes #12