From e5b393f47fc96ae72bcb29cb2b86d350254df7b5 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 21 Mar 2023 19:59:54 -0400 Subject: [PATCH 1/9] Add cover grammar for 'await using' --- spec.emu | 143 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 36 deletions(-) diff --git a/spec.emu b/spec.emu index d7a63af..895ee59 100644 --- a/spec.emu +++ b/spec.emu @@ -71,7 +71,7 @@ contributors: Ron Buckton, Ecma International `"Symbol.asyncDispose"` - A method that performs explicit resource cleanup on an object. Called by the semantics of the `using await` declaration and AsyncDisposableStack objects. + A method that performs explicit resource cleanup on an object. Called by the semantics of the `await using` declaration and AsyncDisposableStack objects. @@ -975,7 +975,7 @@ contributors: Ron Buckton, Ecma International ~sync-dispose~ or ~async-dispose~. - Indicates whether the resource was added by a `using` declaration or DisposableStack object (~sync-dispose~) or a `using await` declaration or AsyncDisposableStack object (~async-dispose~). + Indicates whether the resource was added by a `using` declaration or DisposableStack object (~sync-dispose~) or a `await using` declaration or AsyncDisposableStack object (~async-dispose~). @@ -1150,9 +1150,8 @@ contributors: Ron Buckton, Ecma International - UsingDeclaration : - `using` BindingList `;` - `using await` BindingList `;` + UsingDeclaration : `using` BindingList `;` + AwaitUsingDeclaration : `await` `using` BindingList `;` 1. Return the BoundNames of |BindingList|. @@ -1460,9 +1459,8 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - UsingDeclaration : - `using` BindingList `;` - `using` `await` BindingList `;` + UsingDeclaration : `using` BindingList `;` + AwaitUsingDeclaration : `await` `using` BindingList `;` 1. Return *true*. @@ -1474,7 +1472,7 @@ contributors: Ron Buckton, Ecma International ForDeclaration : `using` ForBinding - `using` `await` ForBinding + `await` `using` ForBinding 1. Return *true*. @@ -1530,7 +1528,7 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - UsingDeclaration : `using` `await` BindingList `;` + AwaitUsingDeclaration : `await` `using` BindingList `;` 1. Return *true*. @@ -1542,7 +1540,7 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - ForDeclaration : `using` `await` ForBinding + ForDeclaration : `await` `using` ForBinding 1. Return *true*. @@ -1821,7 +1819,7 @@ contributors: Ron Buckton, Ecma International InitializeBinding(N, V, _hint_) - Set the value of an already existing but uninitialized binding in an Environment Record. The String value _N_ is the text of the bound name. _V_ is the value for the binding and is a value of any ECMAScript language type. _hint_ indicates whether the binding came from either a `using` declaration (~sync-dispose~), a `using await` declaration (~async-dispose~), or a regular variable declaration (~normal~). + Set the value of an already existing but uninitialized binding in an Environment Record. The String value _N_ is the text of the bound name. _V_ is the value for the binding and is a value of any ECMAScript language type. _hint_ indicates whether the binding came from either a `using` declaration (~sync-dispose~), a `await using` declaration (~async-dispose~), or a regular variable declaration (~normal~). @@ -1879,7 +1877,7 @@ contributors: Ron Buckton, Ecma International

Declarative Environment Records

Each Declarative Environment Record is associated with an ECMAScript program scope containing variable, constant, let, class, module, import, and/or function declarations. A declarative Environment Record binds the set of identifiers defined by the declarations contained within its scope.

-

Every Declarative Environment Record also has a [[DisposeCapability]] field, which contains a DisposeCapability Record. This field holds a stack of resources tracked by the `using` declarations and `using await` declarations that must be disposed when the Evaluation step that constructed the Environment Record has completed.

+

Every Declarative Environment Record also has a [[DisposeCapability]] field, which contains a DisposeCapability Record. This field holds a stack of resources tracked by the `using` declarations and `await using` declarations that must be disposed when the Evaluation step that constructed the Environment Record has completed.

The behaviour of the concrete specification methods for Declarative Environment Records is defined by the following algorithms.

@@ -2112,6 +2110,45 @@ contributors: Ron Buckton, Ecma International
+ +

ECMAScript Language: Expressions

+ +

Unary Operators

+

Syntax

+ + UnaryExpression[Yield, Await] : + UpdateExpression[?Yield, ?Await] + `delete` UnaryExpression[?Yield, ?Await] + `void` UnaryExpression[?Yield, ?Await] + `typeof` UnaryExpression[?Yield, ?Await] + `+` UnaryExpression[?Yield, ?Await] + `-` UnaryExpression[?Yield, ?Await] + `~` UnaryExpression[?Yield, ?Await] + `!` UnaryExpression[?Yield, ?Await] + [+Await] AwaitExpression[?Yield] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] + + + CoverAwaitExpressionAndAwaitUsingDeclaration[Yield] : + `await` UnaryExpression[Yield, +Await] + `await` UnaryExpression[Yield, +Await] [no LineTerminator here] BindingList[+In, ?Yield, +Await, ~Pattern] `;` + + + +

Supplemental Syntax

+

+ When processing an instance of the production
+ UnaryExpression[Yield, Await] : CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield]
+ the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar: +

+ + AwaitExpression[?Yield] : + `await` UnaryExpression[?Yield, +Await] + +
+
+
+

ECMAScript Language: Statements and Declarations

@@ -2179,36 +2216,48 @@ contributors: Ron Buckton, Ecma International

Syntax

LexicalDeclaration[In, Yield, Await] : - LetOrConst BindingList[?In, ?Yield, ?Await, ~Using] `;` + LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern] `;` UsingDeclaration[?In, ?Yield, ?Await] LetOrConst : `let` `const` - + UsingDeclaration[In, Yield, Await] : - `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, +Using] `;` - [+Await] `using` [no LineTerminator here] `await` [no LineTerminator here] BindingList[?In, ?Yield, +Await, +Using] `;` + `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] - BindingList[In, Yield, Await, Using] : - LexicalBinding[?In, ?Yield, ?Await, ?Using] - BindingList[?In, ?Yield, ?Await, ?Using] `,` LexicalBinding[?In, ?Yield, ?Await, ?Using] + BindingList[In, Yield, Await, Pattern] : + LexicalBinding[?In, ?Yield, ?Await, ?Pattern] + BindingList[?In, ?Yield, ?Await, ?Pattern] `,` LexicalBinding[?In, ?Yield, ?Await, ?Pattern] - LexicalBinding[In, Yield, Await, Using] : + LexicalBinding[In, Yield, Await, Pattern] : BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] - [~Using] BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + [+Pattern] BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] + +

Supplemental Syntax

+

+ When processing an instance of the production
+ UsingDeclaration[Yield, Await] : CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield]
+ the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar: +

+ + AwaitUsingDeclaration[?Yield] : + `await` [no LineTerminator here] `using` [no LineTerminator here] BindingList[+In, ?Yield, +Await, ~Pattern] `;` + +
+

Static Semantics: Early Errors

- UsingDeclaration : - `using` BindingList `;` - `using` `await` BindingList `;` + UsingDeclaration : `using` BindingList `;` + AwaitUsingDeclaration : `await` `using` BindingList `;`
  • @@ -2253,7 +2302,7 @@ contributors: Ron Buckton, Ecma International 1. Return ~empty~. - UsingDeclaration : `using` `await` BindingList `;` + AwaitUsingDeclaration : `await` `using` BindingList `;` 1. Perform ? BindingEvaluation of |BindingList| with parameter ~async-dispose~. 1. Return ~empty~. @@ -2474,24 +2523,24 @@ contributors: Ron Buckton, Ecma International ForInOfStatement[Yield, Await, Return] : `for` `(` [lookahead != `let` `[`] LeftHandSideExpression[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` `var` ForBinding[?Yield, ?Await, ~Using] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `for` `(` ForDeclaration[?Yield, ?Await, ~Using] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `for` `(` [lookahead ∉ {`let`, `async` `of`}] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - `for` `(` `var` ForBinding[?Yield, ?Await, ~Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `for` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] [+Await] `for` `await` `(` [lookahead != `let`] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] - [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await, ~Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + [+Await] `for` `await` `(` `var` ForBinding[?Yield, ?Await, +Pattern] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] [+Await] `for` `await` `(` [lookahead != `using` `of`] ForDeclaration[?Yield, ?Await, +Using] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] ForDeclaration[Yield, Await, Using] : - LetOrConst ForBinding[?Yield, ?Await, ~Using] - [+Using] `using` [no LineTerminator here] [lookahead != `await`] ForBinding[?Yield, ?Await, +Using] - [+Using, +Await] `using` [no LineTerminator here] `await` [no LineTerminator here] ForBinding[?Yield, +Await, +Using] + LetOrConst ForBinding[?Yield, ?Await, +Pattern] + [+Using] `using` [no LineTerminator here] [lookahead != `await`] ForBinding[?Yield, ?Await, ~Pattern] + [+Using, +Await] `await` [no LineTerminator here] `using` [no LineTerminator here] ForBinding[?Yield, +Await, ~Pattern] - ForBinding[Yield, Await, Using] : + ForBinding[Yield, Await, Pattern] : BindingIdentifier[?Yield, ?Await] BindingPattern[?Yield, ?Await] - [~Using] BindingPattern[?Yield, ?Await] + [+Pattern] BindingPattern[?Yield, ?Await] @@ -2515,7 +2564,7 @@ contributors: Ron Buckton, Ecma International ForDeclaration : `using` ForBinding - `using` `await` ForBinding + `await` `using` ForBinding 1. Assert: _environment_ is a declarative Environment Record. @@ -2962,6 +3011,28 @@ contributors: Ron Buckton, Ecma International

    Async Function Definitions

    +

    Syntax

    + + AsyncFunctionDeclaration[Yield, Await, Default] : + `async` [no LineTerminator here] `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + + AsyncFunctionExpression : + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await]? `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + + AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] ClassElementName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + + AsyncFunctionBody : + FunctionBody[~Yield, +Await] + + AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + + CoverAwaitExpressionAndAwaitUsingDeclaration[Yield] : + `await` UnaryExpression[?Yield, +Await] [no LineTerminator here] [] + +

    Runtime Semantics: InstantiateAsyncFunctionExpression ( @@ -3915,7 +3986,7 @@ contributors: Ron Buckton, Ecma International

    Invoking this method notifies the AsyncDisposable object that the caller does not intend to continue to use this object. This method should perform any necessary logic to perform explicit clean-up of the resource including, but not limited to, file system handles, streams, host objects, etc. When an exception is thrown from this method, it typically means that the resource could not be explicitly freed. An AsyncDisposable object is not considered "disposed" until the resulting Promise has been fulfilled.

    If called more than once on the same object, the function should not throw an exception. However, this requirement is not enforced.

    -

    When using an AsyncDisposable object, it is good practice to create the instance with a `using await` declaration, as the resource will be automatically disposed when the |Block| or |Module| immediately containing the declaration has been evaluated.

    +

    When using an AsyncDisposable object, it is good practice to create the instance with a `await using` declaration, as the resource will be automatically disposed when the |Block| or |Module| immediately containing the declaration has been evaluated.

    From cfe38b9a2c8aec59992456ce2f44fa6ca742a013 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 21 Mar 2023 22:29:35 -0400 Subject: [PATCH 2/9] Add missing semantics --- spec.emu | 354 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 353 insertions(+), 1 deletion(-) diff --git a/spec.emu b/spec.emu index 895ee59..d88afec 100644 --- a/spec.emu +++ b/spec.emu @@ -1585,6 +1585,157 @@ contributors: Ron Buckton, Ecma International + +

    Function Name Inference

    + +

    Static Semantics: IsFunctionDefinition ( ): a Boolean

    +
    +
    + PrimaryExpression : CoverParenthesizedExpressionAndArrowParameterList + + 1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|. + 1. Return IsFunctionDefinition of _expr_. + + + PrimaryExpression : + `this` + IdentifierReference + Literal + ArrayLiteral + ObjectLiteral + RegularExpressionLiteral + TemplateLiteral + + MemberExpression : + MemberExpression `[` Expression `]` + MemberExpression `.` IdentifierName + MemberExpression TemplateLiteral + SuperProperty + MetaProperty + `new` MemberExpression Arguments + MemberExpression `.` PrivateIdentifier + + NewExpression : + `new` NewExpression + + LeftHandSideExpression : + CallExpression + OptionalExpression + + UpdateExpression : + LeftHandSideExpression `++` + LeftHandSideExpression `--` + `++` UnaryExpression + `--` UnaryExpression + + UnaryExpression : + `delete` UnaryExpression + `void` UnaryExpression + `typeof` UnaryExpression + `+` UnaryExpression + `-` UnaryExpression + `~` UnaryExpression + `!` UnaryExpression + AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclaration + + + AwaitExpression : + `await` UnaryExpression + + + ExponentiationExpression : + UpdateExpression `**` ExponentiationExpression + + MultiplicativeExpression : + MultiplicativeExpression MultiplicativeOperator ExponentiationExpression + + AdditiveExpression : + AdditiveExpression `+` MultiplicativeExpression + AdditiveExpression `-` MultiplicativeExpression + + ShiftExpression : + ShiftExpression `<<` AdditiveExpression + ShiftExpression `>>` AdditiveExpression + ShiftExpression `>>>` AdditiveExpression + + RelationalExpression : + RelationalExpression `<` ShiftExpression + RelationalExpression `>` ShiftExpression + RelationalExpression `<=` ShiftExpression + RelationalExpression `>=` ShiftExpression + RelationalExpression `instanceof` ShiftExpression + RelationalExpression `in` ShiftExpression + PrivateIdentifier `in` ShiftExpression + + EqualityExpression : + EqualityExpression `==` RelationalExpression + EqualityExpression `!=` RelationalExpression + EqualityExpression `===` RelationalExpression + EqualityExpression `!==` RelationalExpression + + BitwiseANDExpression : + BitwiseANDExpression `&` EqualityExpression + + BitwiseXORExpression : + BitwiseXORExpression `^` BitwiseANDExpression + + BitwiseORExpression : + BitwiseORExpression `|` BitwiseXORExpression + + LogicalANDExpression : + LogicalANDExpression `&&` BitwiseORExpression + + LogicalORExpression : + LogicalORExpression `||` LogicalANDExpression + + CoalesceExpression : + CoalesceExpressionHead `??` BitwiseORExpression + + ConditionalExpression : + ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression + + AssignmentExpression : + YieldExpression + LeftHandSideExpression `=` AssignmentExpression + LeftHandSideExpression AssignmentOperator AssignmentExpression + LeftHandSideExpression `&&=` AssignmentExpression + LeftHandSideExpression `||=` AssignmentExpression + LeftHandSideExpression `??=` AssignmentExpression + + Expression : + Expression `,` AssignmentExpression + + + 1. Return *false*. + + + AssignmentExpression : + ArrowFunction + AsyncArrowFunction + + FunctionExpression : + `function` BindingIdentifier? `(` FormalParameters `)` `{` FunctionBody `}` + + GeneratorExpression : + `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` GeneratorBody `}` + + AsyncGeneratorExpression : + `async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}` + + AsyncFunctionExpression : + `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + ClassExpression : + `class` BindingIdentifier? ClassTail + + + 1. Return *true*. + +
    +
    + +

    Miscellaneous

    @@ -1765,6 +1916,170 @@ contributors: Ron Buckton, Ecma International
    + +

    Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~

    +
    +
    + IdentifierReference : Identifier + + 1. If this |IdentifierReference| is contained in strict mode code and StringValue of |Identifier| is *"eval"* or *"arguments"*, return ~invalid~. + 1. Return ~simple~. + + + IdentifierReference : + `yield` + `await` + + CallExpression : + CallExpression `[` Expression `]` + CallExpression `.` IdentifierName + CallExpression `.` PrivateIdentifier + + MemberExpression : + MemberExpression `[` Expression `]` + MemberExpression `.` IdentifierName + SuperProperty + MemberExpression `.` PrivateIdentifier + + + 1. Return ~simple~. + + + PrimaryExpression : + CoverParenthesizedExpressionAndArrowParameterList + + + 1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|. + 1. Return AssignmentTargetType of _expr_. + + + PrimaryExpression : + `this` + Literal + ArrayLiteral + ObjectLiteral + FunctionExpression + ClassExpression + GeneratorExpression + AsyncFunctionExpression + AsyncGeneratorExpression + RegularExpressionLiteral + TemplateLiteral + + CallExpression : + CoverCallExpressionAndAsyncArrowHead + SuperCall + ImportCall + CallExpression Arguments + CallExpression TemplateLiteral + + NewExpression : + `new` NewExpression + + MemberExpression : + MemberExpression TemplateLiteral + `new` MemberExpression Arguments + + NewTarget : + `new` `.` `target` + + ImportMeta : + `import` `.` `meta` + + LeftHandSideExpression : + OptionalExpression + + UpdateExpression : + LeftHandSideExpression `++` + LeftHandSideExpression `--` + `++` UnaryExpression + `--` UnaryExpression + + UnaryExpression : + `delete` UnaryExpression + `void` UnaryExpression + `typeof` UnaryExpression + `+` UnaryExpression + `-` UnaryExpression + `~` UnaryExpression + `!` UnaryExpression + AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclaration + + + AwaitExpression : + `await` UnaryExpression + + + ExponentiationExpression : + UpdateExpression `**` ExponentiationExpression + + MultiplicativeExpression : + MultiplicativeExpression MultiplicativeOperator ExponentiationExpression + + AdditiveExpression : + AdditiveExpression `+` MultiplicativeExpression + AdditiveExpression `-` MultiplicativeExpression + + ShiftExpression : + ShiftExpression `<<` AdditiveExpression + ShiftExpression `>>` AdditiveExpression + ShiftExpression `>>>` AdditiveExpression + + RelationalExpression : + RelationalExpression `<` ShiftExpression + RelationalExpression `>` ShiftExpression + RelationalExpression `<=` ShiftExpression + RelationalExpression `>=` ShiftExpression + RelationalExpression `instanceof` ShiftExpression + RelationalExpression `in` ShiftExpression + PrivateIdentifier `in` ShiftExpression + + EqualityExpression : + EqualityExpression `==` RelationalExpression + EqualityExpression `!=` RelationalExpression + EqualityExpression `===` RelationalExpression + EqualityExpression `!==` RelationalExpression + + BitwiseANDExpression : + BitwiseANDExpression `&` EqualityExpression + + BitwiseXORExpression : + BitwiseXORExpression `^` BitwiseANDExpression + + BitwiseORExpression : + BitwiseORExpression `|` BitwiseXORExpression + + LogicalANDExpression : + LogicalANDExpression `&&` BitwiseORExpression + + LogicalORExpression : + LogicalORExpression `||` LogicalANDExpression + + CoalesceExpression : + CoalesceExpressionHead `??` BitwiseORExpression + + ConditionalExpression : + ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression + + AssignmentExpression : + YieldExpression + ArrowFunction + AsyncArrowFunction + LeftHandSideExpression `=` AssignmentExpression + LeftHandSideExpression AssignmentOperator AssignmentExpression + LeftHandSideExpression `&&=` AssignmentExpression + LeftHandSideExpression `||=` AssignmentExpression + LeftHandSideExpression `??=` AssignmentExpression + + Expression : + Expression `,` AssignmentExpression + + + 1. Return ~invalid~. + +
    + @@ -2255,6 +2570,12 @@ contributors: Ron Buckton, Ecma International

    Static Semantics: Early Errors

    + + UsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + +
      +
    • |CoverAwaitExpressionAndAwaitUsingDeclaration| must cover an |AwaitUsingDeclaration|.
    • +
    UsingDeclaration : `using` BindingList `;` AwaitUsingDeclaration : `await` `using` BindingList `;` @@ -3033,6 +3354,18 @@ contributors: Ron Buckton, Ecma International `await` UnaryExpression[?Yield, +Await] [no LineTerminator here] [] + +

    Static Semantics: Early Errors

    + + + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclaration + +
      +
    • |CoverAwaitExpressionAndAwaitUsingDeclaration| must cover an |AwaitExpression|.
    • +
    +
    +
    +

    Runtime Semantics: InstantiateAsyncFunctionExpression ( @@ -3073,6 +3406,19 @@ contributors: Ron Buckton, Ecma International

    The |BindingIdentifier| in an |AsyncFunctionExpression| can be referenced from inside the |AsyncFunctionExpression|'s |AsyncFunctionBody| to allow the function to call itself recursively. However, unlike in a |FunctionDeclaration|, the |BindingIdentifier| in a |AsyncFunctionExpression| cannot be referenced from and does not affect the scope enclosing the |AsyncFunctionExpression|.

    + + +

    Runtime Semantics: Evaluation

    + + + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclaration + + + 1. Let _expr_ be the |AwaitExpression| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return ? Evaluation of _expr_. + + +
    @@ -3295,7 +3641,13 @@ contributors: Ron Buckton, Ecma International `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression - AwaitExpression + AwaitExpression + CoverAwaitExpressionAndAwaitUsingDeclaration + + + AwaitExpression : + `await` UnaryExpression + CallExpression : SuperCall From 555c1a922c8a4503a773173c5037caf19a97b142 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 11:50:06 -0400 Subject: [PATCH 3/9] Rename IsUsingAwaitDeclaration --- spec.emu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.emu b/spec.emu index d88afec..2356052 100644 --- a/spec.emu +++ b/spec.emu @@ -1516,8 +1516,8 @@ contributors: Ron Buckton, Ecma International - -

    Static Semantics: IsUsingAwaitDeclaration ( ): a Boolean

    + +

    Static Semantics: IsAwaitUsingDeclaration ( ): a Boolean

    LexicalDeclaration : LetOrConst BindingList `;` @@ -2913,7 +2913,7 @@ contributors: Ron Buckton, Ecma International 1. If _iteratorKind_ is not present, set _iteratorKind_ to ~sync~. 1. Let _oldEnv_ be the running execution context's LexicalEnvironment. 1. Let _V_ be *undefined*. - 1. If IsUsingAwaitDeclaration of _lhs_ is *true*, then + 1. If IsAwaitUsingDeclaration of _lhs_ is *true*, then 1. Let _hint_ be ~async-dispose~. 1. Else, if IsUsingDeclaration of _lhs_ is *true*, then 1. Let _hint_ be ~sync-dispose~. From 52e66036ffb066edde1d89f02a7bc87056a8bdb8 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 12:57:26 -0400 Subject: [PATCH 4/9] SDO and syntax cleanup --- spec.emu | 110 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 88 insertions(+), 22 deletions(-) diff --git a/spec.emu b/spec.emu index 2356052..fb3384d 100644 --- a/spec.emu +++ b/spec.emu @@ -1149,9 +1149,17 @@ contributors: Ron Buckton, Ecma International 1. Return the BoundNames of |BindingList|. + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + + 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return the BoundNames of _decl_. + - UsingDeclaration : `using` BindingList `;` - AwaitUsingDeclaration : `await` `using` BindingList `;` + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + `await` `using` BindingList `;` 1. Return the BoundNames of |BindingList|. @@ -1394,9 +1402,10 @@ contributors: Ron Buckton, Ecma International 1. Return IsConstantDeclaration of |LetOrConst|. - LexicalDeclaration : UsingDeclaration + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - 1. Return *true*. + 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return IsConstantDeclaration of _decl_. LetOrConst : `let` @@ -1407,6 +1416,18 @@ contributors: Ron Buckton, Ecma International 1. Return *true*. + + + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + `await` `using` BindingList `;` + + + 1. Return *true*. + + FunctionDeclaration : `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}` @@ -1458,9 +1479,17 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + + 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return IsUsingDeclaration of _decl_. + - UsingDeclaration : `using` BindingList `;` - AwaitUsingDeclaration : `await` `using` BindingList `;` + UsingDeclaration : + `using` BindingList `;` + + AwaitUsingDeclaration : + `await` `using` BindingList `;` 1. Return *true*. @@ -1524,6 +1553,11 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + + 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return IsAwaitUsingDeclaration of _decl_. + UsingDeclaration : `using` BindingList `;` 1. Return *false*. @@ -2441,22 +2475,22 @@ contributors: Ron Buckton, Ecma International `~` UnaryExpression[?Yield, ?Await] `!` UnaryExpression[?Yield, ?Await] [+Await] AwaitExpression[?Yield] - [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[+In, ?Yield] - CoverAwaitExpressionAndAwaitUsingDeclaration[Yield] : + CoverAwaitExpressionAndAwaitUsingDeclaration[In, Yield] : `await` UnaryExpression[Yield, +Await] - `await` UnaryExpression[Yield, +Await] [no LineTerminator here] BindingList[+In, ?Yield, +Await, ~Pattern] `;` + `await` UnaryExpression[Yield, +Await] [no LineTerminator here] BindingList[?In, ?Yield, +Await, ~Pattern] `;`

    Supplemental Syntax

    When processing an instance of the production
    - UnaryExpression[Yield, Await] : CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield]
    + UnaryExpression[Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[+In, ?Yield]
    the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar:

    - + AwaitExpression[?Yield] : `await` UnaryExpression[?Yield, +Await] @@ -2533,6 +2567,7 @@ contributors: Ron Buckton, Ecma International LexicalDeclaration[In, Yield, Await] : LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern] `;` UsingDeclaration[?In, ?Yield, ?Await] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] LetOrConst : `let` @@ -2541,7 +2576,6 @@ contributors: Ron Buckton, Ecma International UsingDeclaration[In, Yield, Await] : `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` - [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] BindingList[In, Yield, Await, Pattern] : @@ -2558,12 +2592,12 @@ contributors: Ron Buckton, Ecma International

    Supplemental Syntax

    When processing an instance of the production
    - UsingDeclaration[Yield, Await] : CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield]
    + LexicalDeclaration[In, Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?In, ?Yield]
    the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar:

    - AwaitUsingDeclaration[?Yield] : - `await` [no LineTerminator here] `using` [no LineTerminator here] BindingList[+In, ?Yield, +Await, ~Pattern] `;` + AwaitUsingDeclaration[?In, ?Yield] : + `await` [no LineTerminator here] `using` [no LineTerminator here] BindingList[?In, ?Yield, +Await, ~Pattern] `;`
    @@ -2571,14 +2605,14 @@ contributors: Ron Buckton, Ecma International

    Static Semantics: Early Errors

    - UsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration
    • |CoverAwaitExpressionAndAwaitUsingDeclaration| must cover an |AwaitUsingDeclaration|.
    - UsingDeclaration : `using` BindingList `;` - AwaitUsingDeclaration : `await` `using` BindingList `;` + UsingDeclaration : + `using` BindingList `;`
    • @@ -2594,6 +2628,24 @@ contributors: Ron Buckton, Ecma International It is a Syntax Error if the goal symbol is |Script| and |UsingDeclaration| is not contained, either directly or indirectly, within a |Block|, |CaseBlock|, |ForStatement|, |ForInOfStatement|, |FunctionBody|, |GeneratorBody|, |AsyncGeneratorBody|, |AsyncFunctionBody|, |ClassStaticBlockBody|, or |ClassBody|.
    + + AwaitUsingDeclaration : + `await` `using` BindingList `;` + +
      +
    • + It is a Syntax Error if the BoundNames of |BindingList| contains *"let"*. +
    • +
    • + It is a Syntax Error if the BoundNames of |BindingList| contains *"await"*. +
    • +
    • + It is a Syntax Error if the BoundNames of |BindingList| contains any duplicate entries. +
    • +
    • + It is a Syntax Error if the goal symbol is |Script| and |AwaitUsingDeclaration| is not contained, either directly or indirectly, within a |Block|, |CaseBlock|, |ForStatement|, |ForInOfStatement|, |FunctionBody|, |GeneratorBody|, |AsyncGeneratorBody|, |AsyncFunctionBody|, |ClassStaticBlockBody|, or |ClassBody|. +
    • +
    Draft Note: This behavior is currently under discussion in #66. The above boundaries have been chosen for the following reasons:
      @@ -2617,6 +2669,12 @@ contributors: Ron Buckton, Ecma International + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + + 1. Let _decl_ be the |AwaitUsingDeclaration| covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Perform ? Evaluation of _decl_. + + UsingDeclaration : `using` BindingList `;` 1. Perform ? BindingEvaluation of |BindingList| with parameter ~sync-dispose~. @@ -3349,9 +3407,6 @@ contributors: Ron Buckton, Ecma International AwaitExpression[Yield] : `await` UnaryExpression[?Yield, +Await] - - CoverAwaitExpressionAndAwaitUsingDeclaration[Yield] : - `await` UnaryExpression[?Yield, +Await] [no LineTerminator here] [] @@ -3802,7 +3857,18 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - LexicalDeclaration : UsingDeclaration + LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration + + 1. Let _decl_ be the |AwaitUsingDeclaration| covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Return HasUnterminatedUsingDeclaration of _decl_. + + + UsingDeclaration : `using` BindingList `;` + + 1. Return *true*. + + + AwaitUsingDeclaration : `await` `using` BindingList `;` 1. Return *true*. From 88bf9c727cdc99bf1b60226432d3e9404842839f Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 13:00:19 -0400 Subject: [PATCH 5/9] add missing nonterminal argument --- spec.emu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.emu b/spec.emu index fb3384d..3993708 100644 --- a/spec.emu +++ b/spec.emu @@ -2567,7 +2567,7 @@ contributors: Ron Buckton, Ecma International LexicalDeclaration[In, Yield, Await] : LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern] `;` UsingDeclaration[?In, ?Yield, ?Await] - [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?Yield] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?In, ?Yield] LetOrConst : `let` From 01dd08de2d6be9d7c088f8c636dc93c914f58ce1 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 13:25:09 -0400 Subject: [PATCH 6/9] Add missing Return --- spec.emu | 1 + 1 file changed, 1 insertion(+) diff --git a/spec.emu b/spec.emu index 3993708..0ab94ad 100644 --- a/spec.emu +++ b/spec.emu @@ -2673,6 +2673,7 @@ contributors: Ron Buckton, Ecma International 1. Let _decl_ be the |AwaitUsingDeclaration| covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. 1. Perform ? Evaluation of _decl_. + 1. Return ~empty~. UsingDeclaration : `using` BindingList `;` From c07aa358f543ef1413b155faa6c66e9d5c435074 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 14:37:06 -0400 Subject: [PATCH 7/9] Simplify cover grammar --- spec.emu | 108 ++++++++++++++++++------------------------------------- 1 file changed, 34 insertions(+), 74 deletions(-) diff --git a/spec.emu b/spec.emu index 0ab94ad..870b1b2 100644 --- a/spec.emu +++ b/spec.emu @@ -1149,17 +1149,12 @@ contributors: Ron Buckton, Ecma International 1. Return the BoundNames of |BindingList|. - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Return the BoundNames of _decl_. - UsingDeclaration : `using` BindingList `;` AwaitUsingDeclaration : - `await` `using` BindingList `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` 1. Return the BoundNames of |BindingList|. @@ -1401,13 +1396,6 @@ contributors: Ron Buckton, Ecma International 1. Return IsConstantDeclaration of |LetOrConst|. - - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Return IsConstantDeclaration of _decl_. - - LetOrConst : `let` 1. Return *false*. @@ -1422,7 +1410,7 @@ contributors: Ron Buckton, Ecma International `using` BindingList `;` AwaitUsingDeclaration : - `await` `using` BindingList `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` 1. Return *true*. @@ -1479,17 +1467,12 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Return IsUsingDeclaration of _decl_. - UsingDeclaration : `using` BindingList `;` AwaitUsingDeclaration : - `await` `using` BindingList `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` 1. Return *true*. @@ -1553,16 +1536,11 @@ contributors: Ron Buckton, Ecma International 1. Return *false*. - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Return IsAwaitUsingDeclaration of _decl_. - UsingDeclaration : `using` BindingList `;` 1. Return *false*. - AwaitUsingDeclaration : `await` `using` BindingList `;` + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` 1. Return *true*. @@ -1671,7 +1649,7 @@ contributors: Ron Buckton, Ecma International `~` UnaryExpression `!` UnaryExpression AwaitExpression - CoverAwaitExpressionAndAwaitUsingDeclaration + CoverAwaitExpressionAndAwaitUsingDeclarationHead AwaitExpression : @@ -2038,7 +2016,7 @@ contributors: Ron Buckton, Ecma International `~` UnaryExpression `!` UnaryExpression AwaitExpression - CoverAwaitExpressionAndAwaitUsingDeclaration + CoverAwaitExpressionAndAwaitUsingDeclarationHead AwaitExpression : @@ -2475,20 +2453,19 @@ contributors: Ron Buckton, Ecma International `~` UnaryExpression[?Yield, ?Await] `!` UnaryExpression[?Yield, ?Await] [+Await] AwaitExpression[?Yield] - [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[+In, ?Yield] + [+Await] CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] - CoverAwaitExpressionAndAwaitUsingDeclaration[In, Yield] : - `await` UnaryExpression[Yield, +Await] - `await` UnaryExpression[Yield, +Await] [no LineTerminator here] BindingList[?In, ?Yield, +Await, ~Pattern] `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead[Yield] : + `await` UnaryExpression[?Yield, +Await]

      Supplemental Syntax

      When processing an instance of the production
      - UnaryExpression[Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[+In, ?Yield]
      - the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar: + UnaryExpression[Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield]
      + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar:

      AwaitExpression[?Yield] : @@ -2567,7 +2544,7 @@ contributors: Ron Buckton, Ecma International LexicalDeclaration[In, Yield, Await] : LetOrConst BindingList[?In, ?Yield, ?Await, +Pattern] `;` UsingDeclaration[?In, ?Yield, ?Await] - [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?In, ?Yield] + [+Await] AwaitUsingDeclaration[?In, ?Yield] LetOrConst : `let` @@ -2576,6 +2553,9 @@ contributors: Ron Buckton, Ecma International UsingDeclaration[In, Yield, Await] : `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + + AwaitUsingDeclaration[In, Yield] : + CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` BindingList[In, Yield, Await, Pattern] : @@ -2592,24 +2572,18 @@ contributors: Ron Buckton, Ecma International

      Supplemental Syntax

      When processing an instance of the production
      - LexicalDeclaration[In, Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclaration[?In, ?Yield]
      - the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclaration| is refined using the following grammar: + AwaitUsingDeclaration[In, Yield] : CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;`
      + the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar:

      - AwaitUsingDeclaration[?In, ?Yield] : - `await` [no LineTerminator here] `using` [no LineTerminator here] BindingList[?In, ?Yield, +Await, ~Pattern] `;` + AwaitUsingDeclarationHead : + `await` [no LineTerminator here] `using`
      - +

      Static Semantics: Early Errors

      - - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - -
        -
      • |CoverAwaitExpressionAndAwaitUsingDeclaration| must cover an |AwaitUsingDeclaration|.
      • -
      UsingDeclaration : `using` BindingList `;` @@ -2630,9 +2604,10 @@ contributors: Ron Buckton, Ecma International
    AwaitUsingDeclaration : - `await` `using` BindingList `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;`
      +
    • |CoverAwaitExpressionAndAwaitUsingDeclarationHead| must cover an |AwaitUsingDeclarationHead|.
    • It is a Syntax Error if the BoundNames of |BindingList| contains *"let"*.
    • @@ -2667,28 +2642,18 @@ contributors: Ron Buckton, Ecma International 1. Perform ? EvaluationBindingEvaluation of |BindingList| with parameter ~normal~. 1. Return ~empty~. - - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Perform ? Evaluation of _decl_. - 1. Return ~empty~. - - UsingDeclaration : `using` BindingList `;` 1. Perform ? BindingEvaluation of |BindingList| with parameter ~sync-dispose~. 1. Return ~empty~. - - AwaitUsingDeclaration : `await` `using` BindingList `;` + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` 1. Perform ? BindingEvaluation of |BindingList| with parameter ~async-dispose~. 1. Return ~empty~. - BindingList : BindingList `,` LexicalBinding @@ -3414,10 +3379,10 @@ contributors: Ron Buckton, Ecma International

      Static Semantics: Early Errors

      - UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclaration + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclarationHead
        -
      • |CoverAwaitExpressionAndAwaitUsingDeclaration| must cover an |AwaitExpression|.
      • +
      • |CoverAwaitExpressionAndAwaitUsingDeclarationHead| must cover an |AwaitExpression|.
      @@ -3467,10 +3432,10 @@ contributors: Ron Buckton, Ecma International

      Runtime Semantics: Evaluation

      - UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclaration + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclarationHead - 1. Let _expr_ be the |AwaitExpression| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. + 1. Let _expr_ be the |AwaitExpression| that is covered by |CoverAwaitExpressionAndAwaitUsingDeclarationHead|. 1. Return ? Evaluation of _expr_. @@ -3698,7 +3663,7 @@ contributors: Ron Buckton, Ecma International `~` UnaryExpression `!` UnaryExpression AwaitExpression - CoverAwaitExpressionAndAwaitUsingDeclaration + CoverAwaitExpressionAndAwaitUsingDeclarationHead AwaitExpression : @@ -3858,18 +3823,13 @@ contributors: Ron Buckton, Ecma International 1. Return *false*.
      - LexicalDeclaration : CoverAwaitExpressionAndAwaitUsingDeclaration - - 1. Let _decl_ be the |AwaitUsingDeclaration| covered by |CoverAwaitExpressionAndAwaitUsingDeclaration|. - 1. Return HasUnterminatedUsingDeclaration of _decl_. - - - UsingDeclaration : `using` BindingList `;` - - 1. Return *true*. - + + UsingDeclaration : + `using` BindingList `;` - AwaitUsingDeclaration : `await` `using` BindingList `;` + AwaitUsingDeclaration : + CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;` + 1. Return *true*. From 9dc7b2ffd33fb8c54e6c55dcb3d09c8883fe3cc8 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Mar 2023 14:54:06 -0400 Subject: [PATCH 8/9] Clean up supplemental syntax --- spec.emu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.emu b/spec.emu index 870b1b2..71a75a5 100644 --- a/spec.emu +++ b/spec.emu @@ -2464,7 +2464,7 @@ contributors: Ron Buckton, Ecma International

      Supplemental Syntax

      When processing an instance of the production
      - UnaryExpression[Yield, Await] : [+Await] CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield]
      + UnaryExpression : CoverAwaitExpressionAndAwaitUsingDeclarationHead
      the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar:

      @@ -2572,7 +2572,7 @@ contributors: Ron Buckton, Ecma International

      Supplemental Syntax

      When processing an instance of the production
      - AwaitUsingDeclaration[In, Yield] : CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;`
      + AwaitUsingDeclaration : CoverAwaitExpressionAndAwaitUsingDeclarationHead BindingList `;`
      the interpretation of |CoverAwaitExpressionAndAwaitUsingDeclarationHead| is refined using the following grammar:

      From 4e5be661f0433016d8e31927f6ae62bf51316f92 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 10 Apr 2023 13:31:12 -0400 Subject: [PATCH 9/9] PR feedback --- spec.emu | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/spec.emu b/spec.emu index 71a75a5..09f44f4 100644 --- a/spec.emu +++ b/spec.emu @@ -2552,10 +2552,10 @@ contributors: Ron Buckton, Ecma International UsingDeclaration[In, Yield, Await] : - `using` [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + `using` [no LineTerminator here] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` AwaitUsingDeclaration[In, Yield] : - CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] [lookahead != `await`] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` + CoverAwaitExpressionAndAwaitUsingDeclarationHead[?Yield] [no LineTerminator here] BindingList[?In, ?Yield, ?Await, ~Pattern] `;` BindingList[In, Yield, Await, Pattern] : @@ -2611,9 +2611,6 @@ contributors: Ron Buckton, Ecma International
    • It is a Syntax Error if the BoundNames of |BindingList| contains *"let"*.
    • -
    • - It is a Syntax Error if the BoundNames of |BindingList| contains *"await"*. -
    • It is a Syntax Error if the BoundNames of |BindingList| contains any duplicate entries.
    • @@ -2879,7 +2876,7 @@ contributors: Ron Buckton, Ecma International ForDeclaration[Yield, Await, Using] : LetOrConst ForBinding[?Yield, ?Await, +Pattern] - [+Using] `using` [no LineTerminator here] [lookahead != `await`] ForBinding[?Yield, ?Await, ~Pattern] + [+Using] `using` [no LineTerminator here] ForBinding[?Yield, ?Await, ~Pattern] [+Using, +Await] `await` [no LineTerminator here] `using` [no LineTerminator here] ForBinding[?Yield, +Await, ~Pattern] ForBinding[Yield, Await, Pattern] :