From 55a3ff7884859fde91559bc981b3f31571271dd2 Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Thu, 15 Sep 2016 13:46:37 -0700 Subject: [PATCH 01/42] Implement Async Functions --- spec.html | 1745 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 1277 insertions(+), 468 deletions(-) diff --git a/spec.html b/spec.html index f8252b6825..c122914a01 100644 --- a/spec.html +++ b/spec.html @@ -1876,6 +1876,26 @@

Well-Known Intrinsic Objects

The initial value of the `prototype` property of %Generator% + + + %AsyncFunction% + + + + + The constructor of async function objects () + + + + + %GeneratorPrototype% + + + + + The initial value of the `prototype` property of %Generator% + + %Int8Array% @@ -8849,7 +8869,7 @@

Types of Source Code

-

Function code is generally provided as the bodies of Function Definitions (), Arrow Function Definitions (), Method Definitions () and Generator Definitions (). Function code is also derived from the arguments to the `Function` constructor () and the GeneratorFunction constructor ().

+

Function code is generally provided as the bodies of Function Definitions (), Arrow Function Definitions (), Method Definitions (), Generator Definitions (), Async Function Definitions (), and Async Arrow Functions (). Function code is also derived from the arguments to the `Function` constructor () and the GeneratorFunction constructor ().

@@ -9369,6 +9389,7 @@

Syntax

Keyword :: one of `break` `do` `in` `typeof` `case` `else` `instanceof` `var` `catch` `export` `new` `void` `class` `extends` `return` `while` `const` `finally` `super` `with` `continue` `for` `switch` `yield` `debugger` `function` `this` `default` `if` `throw` `delete` `import` `try` + `await`

In some contexts `yield` is given the semantics of an |Identifier|. See . In strict mode code, `let` and `static` are treated as reserved keywords through static semantic restrictions (see , , , and ) rather than the lexical grammar.

@@ -10354,31 +10375,31 @@

Rules of Automatic Semicolon Insertion

The following are the only restricted productions in the grammar:

- UpdateExpression[Yield] : - LeftHandSideExpression[?Yield] [no LineTerminator here] `++` - LeftHandSideExpression[?Yield] [no LineTerminator here] `--` + UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` - ContinueStatement[Yield] : + ContinueStatement[Yield, Await] : `continue` `;` - `continue` [no LineTerminator here] LabelIdentifier[?Yield] `;` + `continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` - BreakStatement[Yield] : + BreakStatement[Yield, Await] : `break` `;` - `break` [no LineTerminator here] LabelIdentifier[?Yield] `;` + `break` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` - ReturnStatement[Yield] : + ReturnStatement[Yield, Await] : `return` `;` - `return` [no LineTerminator here] Expression[+In, ?Yield] `;` + `return` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;` - ThrowStatement[Yield] : - `throw` [no LineTerminator here] Expression[+In, ?Yield] `;` + ThrowStatement[Yield, Await] : + `throw` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;` - ArrowFunction[In, Yield] : - ArrowParameters[?Yield] [no LineTerminator here] `=>` ConciseBody[?In] + ArrowFunction[In, Yield, Await] : + ArrowParameters[?Yield, ?Await] [no LineTerminator here] `=>` ConciseBody[?In] - YieldExpression[In] : - `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield] - `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield] + YieldExpression[In, Await] : + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await]

The practical effect of these restricted productions is as follows:

    @@ -10479,17 +10500,20 @@

    ECMAScript Language: Expressions

    Identifiers

    Syntax

    - IdentifierReference[Yield] : + IdentifierReference[Yield, Await] : Identifier [~Yield] `yield` + [~Await] `await` - BindingIdentifier[Yield] : + BindingIdentifier[Yield, Await] : Identifier [~Yield] `yield` + [~Await] `await` - LabelIdentifier[Yield] : + LabelIdentifier[Yield, Await] : Identifier [~Yield] `yield` + [~Await] `await` Identifier : IdentifierName but not ReservedWord @@ -10517,16 +10541,20 @@

    Static Semantics: Early Errors

- IdentifierReference[Yield] : Identifier + IdentifierReference[Yield, Await] : Identifier - BindingIdentifier[Yield] : Identifier + BindingIdentifier[Yield, Await] : Identifier - LabelIdentifier[Yield] : Identifier + LabelIdentifier[Yield, Await] : Identifier
  • It is a Syntax Error if this production has a [Yield] parameter and StringValue of |Identifier| is `"yield"`.
  • +
  • + It is a Syntax Error if this production has an [Await] parameter and StringValue of |Identifier| is `"await"`. +
  • +
Identifier : IdentifierName but not ReservedWord
    @@ -10650,37 +10678,38 @@

    Runtime Semantics: Evaluation

    Primary Expression

    Syntax

    - PrimaryExpression[Yield] : + PrimaryExpression[Yield, Await] : `this` - IdentifierReference[?Yield] + IdentifierReference[?Yield, ?Await] Literal - ArrayLiteral[?Yield] - ObjectLiteral[?Yield] + ArrayLiteral[?Yield, ?Await] + ObjectLiteral[?Yield, ?Await] FunctionExpression - ClassExpression[?Yield] + ClassExpression[?Yield, ?Await] GeneratorExpression + AsyncFunctionExpression RegularExpressionLiteral - TemplateLiteral[?Yield] - CoverParenthesizedExpressionAndArrowParameterList[?Yield] #parencover + TemplateLiteral[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover - CoverParenthesizedExpressionAndArrowParameterList[Yield] : - `(` Expression[+In, ?Yield] `)` - `(` Expression[+In, ?Yield] `,` `)` + CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `)` `(` `)` - `(` `...` BindingIdentifier[?Yield] `)` - `(` `...` BindingPattern[?Yield] `)` - `(` Expression[+In, ?Yield] `,` `...` BindingIdentifier[?Yield] `)` - `(` Expression[+In, ?Yield] `,` `...` BindingPattern[?Yield] `)` + `(` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` `...` BindingPattern[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingIdentifier[?Yield, ?Await] `)` + `(` Expression[+In, ?Yield, ?Await] `,` `...` BindingPattern[?Yield, ?Await] `)`

    Supplemental Syntax

    When processing the production
    - PrimaryExpression[Yield] : CoverParenthesizedExpressionAndArrowParameterList[?Yield] + PrimaryExpression[Yield, Await] : CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
    the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:

    - ParenthesizedExpression[Yield] : - `(` Expression[+In, ?Yield] `)` + ParenthesizedExpression[Yield, Await] : + `(` Expression[+In, ?Yield, ?Await] `)` @@ -10690,9 +10719,9 @@

    Semantics

    Static Semantics: CoveredParenthesizedExpression

    - CoverParenthesizedExpressionAndArrowParameterList[Yield] : `(` Expression[+In, ?Yield] `)` + CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : `(` Expression[+In, ?Yield, ?Await] `)` - 1. Return the result of parsing the lexical token stream matched by |CoverParenthesizedExpressionAndArrowParameterList[Yield]| using either |ParenthesizedExpression[~Yield]| or |ParenthesizedExpression[+Yield]| as the goal symbol depending upon whether the [Yield] grammar parameter was present when |CoverParenthesizedExpressionAndArrowParameterList| was matched. + 1. Return the result of parsing the lexical token stream matched by |CoverParenthesizedExpressionAndArrowParameterList| using |ParenthesizedExpression| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |CoverParenthesizedExpressionAndArrowParameterList|.
    @@ -10849,23 +10878,23 @@

    Array Initializer

    Array elements may be elided at the beginning, middle or end of the element list. Whenever a comma in the element list is not preceded by an |AssignmentExpression| (i.e., a comma at the beginning or after another comma), the missing array element contributes to the length of the Array and increases the index of subsequent elements. Elided array elements are not defined. If an element is elided at the end of an array, that element does not contribute to the length of the Array.

    Syntax

    - ArrayLiteral[Yield] : + ArrayLiteral[Yield, Await] : `[` Elision? `]` - `[` ElementList[?Yield] `]` - `[` ElementList[?Yield] `,` Elision? `]` + `[` ElementList[?Yield, ?Await] `]` + `[` ElementList[?Yield, ?Await] `,` Elision? `]` - ElementList[Yield] : - Elision? AssignmentExpression[+In, ?Yield] - Elision? SpreadElement[?Yield] - ElementList[?Yield] `,` Elision? AssignmentExpression[+In, ?Yield] - ElementList[?Yield] `,` Elision? SpreadElement[?Yield] + ElementList[Yield, Await] : + Elision? AssignmentExpression[+In, ?Yield, ?Await] + Elision? SpreadElement[?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? AssignmentExpression[+In, ?Yield, ?Await] + ElementList[?Yield, ?Await] `,` Elision? SpreadElement[?Yield, ?Await] Elision : `,` Elision `,` - SpreadElement[Yield] : - `...` AssignmentExpression[+In, ?Yield] + SpreadElement[Yield, Await] : + `...` AssignmentExpression[+In, ?Yield, ?Await] @@ -10977,38 +11006,38 @@

    Object Initializer

    Syntax

    - ObjectLiteral[Yield] : + ObjectLiteral[Yield, Await] : `{` `}` - `{` PropertyDefinitionList[?Yield] `}` - `{` PropertyDefinitionList[?Yield] `,` `}` + `{` PropertyDefinitionList[?Yield, ?Await] `}` + `{` PropertyDefinitionList[?Yield, ?Await] `,` `}` - PropertyDefinitionList[Yield] : - PropertyDefinition[?Yield] - PropertyDefinitionList[?Yield] `,` PropertyDefinition[?Yield] + PropertyDefinitionList[Yield, Await] : + PropertyDefinition[?Yield, ?Await] + PropertyDefinitionList[?Yield, ?Await] `,` PropertyDefinition[?Yield, ?Await] - PropertyDefinition[Yield] : - IdentifierReference[?Yield] - CoverInitializedName[?Yield] - PropertyName[?Yield] `:` AssignmentExpression[+In, ?Yield] - MethodDefinition[?Yield] + PropertyDefinition[Yield, Await] : + IdentifierReference[?Yield, ?Await] + CoverInitializedName[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` AssignmentExpression[+In, ?Yield, ?Await] + MethodDefinition[?Yield, ?Await] - PropertyName[Yield] : + PropertyName[Yield, Await] : LiteralPropertyName - ComputedPropertyName[?Yield] + ComputedPropertyName[?Yield, ?Await] LiteralPropertyName : IdentifierName StringLiteral NumericLiteral - ComputedPropertyName[Yield] : - `[` AssignmentExpression[+In, ?Yield] `]` + ComputedPropertyName[Yield, Await] : + `[` AssignmentExpression[+In, ?Yield, ?Await] `]` - CoverInitializedName[Yield] : - IdentifierReference[?Yield] Initializer[+In, ?Yield] + CoverInitializedName[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await] - Initializer[In, Yield] : - `=` AssignmentExpression[?In, ?Yield] + Initializer[In, Yield, Await] : + `=` AssignmentExpression[?In, ?Yield, ?Await]

    |MethodDefinition| is defined in .

    @@ -11026,7 +11055,7 @@

    Static Semantics: Early Errors

    It is a Syntax Error if HasDirectSuper of |MethodDefinition| is *true*.
-

In addition to describing an actual object initializer the |ObjectLiteral| productions are also used as a cover grammar for |ObjectAssignmentPattern|. and may be recognized as part of a |CoverParenthesizedExpressionAndArrowParameterList|. When |ObjectLiteral| appears in a context where |ObjectAssignmentPattern| is required the following Early Error rules are not applied. In addition, they are not applied when initially parsing a |CoverParenthesizedExpressionAndArrowParameterList|.

+

In addition to describing an actual object initializer the |ObjectLiteral| productions are also used as a cover grammar for |ObjectAssignmentPattern| and may be recognized as part of a |CoverParenthesizedExpressionAndArrowParameterList|. When |ObjectLiteral| appears in a context where |ObjectAssignmentPattern| is required the following Early Error rules are not applied. In addition, they are not applied when initially parsing a |CoverParenthesizedExpressionAndArrowParameterList|.

PropertyDefinition : CoverInitializedName
  • @@ -11217,6 +11246,7 @@

    Function Defining Expressions

    See for PrimaryExpression : FunctionExpression.

    See for PrimaryExpression : GeneratorExpression.

    See for PrimaryExpression : ClassExpression.

    +

    See for PrimaryExpression : AsyncFunctionExpression.

    @@ -11256,17 +11286,17 @@

    Runtime Semantics: Evaluation

    Template Literals

    Syntax

    - TemplateLiteral[Yield] : + TemplateLiteral[Yield, Await] : NoSubstitutionTemplate - TemplateHead Expression[+In, ?Yield] TemplateSpans[?Yield] + TemplateHead Expression[+In, ?Yield, ?Await] TemplateSpans[?Yield, ?Await] - TemplateSpans[Yield] : + TemplateSpans[Yield, Await] : TemplateTail - TemplateMiddleList[?Yield] TemplateTail + TemplateMiddleList[?Yield, ?Await] TemplateTail - TemplateMiddleList[Yield] : - TemplateMiddle Expression[+In, ?Yield] - TemplateMiddleList[?Yield] TemplateMiddle Expression[+In, ?Yield] + TemplateMiddleList[Yield, Await] : + TemplateMiddle Expression[+In, ?Yield, ?Await] + TemplateMiddleList[?Yield, ?Await] TemplateMiddle Expression[+In, ?Yield, ?Await] @@ -11539,17 +11569,17 @@

    Runtime Semantics: Evaluation

    Left-Hand-Side Expressions

    Syntax

    - MemberExpression[Yield] : - PrimaryExpression[?Yield] - MemberExpression[?Yield] `[` Expression[+In, ?Yield] `]` - MemberExpression[?Yield] `.` IdentifierName - MemberExpression[?Yield] TemplateLiteral[?Yield] - SuperProperty[?Yield] + MemberExpression[Yield, Await] : + PrimaryExpression[?Yield, ?Await] + MemberExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + MemberExpression[?Yield, ?Await] `.` IdentifierName + MemberExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await] + SuperProperty[?Yield, ?Await] MetaProperty - `new` MemberExpression[?Yield] Arguments[?Yield] + `new` MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] - SuperProperty[Yield] : - `super` `[` Expression[+In, ?Yield] `]` + SuperProperty[Yield, Await] : + `super` `[` Expression[+In, ?Yield, ?Await] `]` `super` `.` IdentifierName MetaProperty : @@ -11558,41 +11588,57 @@

    Syntax

    NewTarget : `new` `.` `target` - NewExpression[Yield] : - MemberExpression[?Yield] - `new` NewExpression[?Yield] - - CallExpression[Yield] : - MemberExpression[?Yield] Arguments[?Yield] - SuperCall[?Yield] - CallExpression[?Yield] Arguments[?Yield] - CallExpression[?Yield] `[` Expression[+In, ?Yield] `]` - CallExpression[?Yield] `.` IdentifierName - CallExpression[?Yield] TemplateLiteral[?Yield] - - SuperCall[Yield] : - `super` Arguments[?Yield] - - Arguments[Yield] : + NewExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] + `new` NewExpression[?Yield, ?Await] + + CallExpression[Yield, Await] : + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` + CallExpression[?Yield, ?Await] `.` IdentifierName + CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await] +" + SuperCall[Yield, Await] : + `super` Arguments[?Yield, ?Await] + + Arguments[Yield, Await] : `(` `)` - `(` ArgumentList[?Yield] `)` - `(` ArgumentList[?Yield] `,` `)` - - ArgumentList[Yield] : - AssignmentExpression[+In, ?Yield] - `...` AssignmentExpression[+In, ?Yield] - ArgumentList[?Yield] `,` AssignmentExpression[+In, ?Yield] - ArgumentList[?Yield] `,` `...` AssignmentExpression[+In, ?Yield] - - LeftHandSideExpression[Yield] : - NewExpression[?Yield] - CallExpression[?Yield] + `(` ArgumentList[?Yield, ?Await] `)` + `(` ArgumentList[?Yield, ?Await] `,` `)` + + ArgumentList[Yield, Await] : + AssignmentExpression[+In, ?Yield, ?Await] + `...` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` AssignmentExpression[+In, ?Yield, ?Await] + ArgumentList[?Yield, ?Await] `,` `...` AssignmentExpression[+In, ?Yield, ?Await] + + LeftHandSideExpression[Yield, Await] : + NewExpression[?Yield, ?Await] + CallExpression[?Yield, ?Await] +
    +

    Supplemental Syntax

    +

    When processing the production CallExpression : CoverCallExpressionAndAsyncArrowHead the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

    + + CallMemberExpression[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]

    Static Semantics

    + +

    Static Semantics: CoveredCallExpression

    + + CallExpression : CoverCallExpressionAndAsyncArrowHead + + + 1. Return the result of parsing the lexical token stream matched by |CoverCallExpressionAndAsyncArrowHead| using |CallMemberExpression| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing |CoverCallExpressionAndAsyncArrowHead|. + +
    +

    Static Semantics: Contains

    @@ -11638,7 +11684,7 @@

    Static Semantics: IsFunctionDefinition

    `new` NewExpression CallExpression : - MemberExpression Arguments + CoverCallExpressionAndAsyncArrowHead SuperCall CallExpression Arguments CallExpression `[` Expression `]` @@ -11672,7 +11718,7 @@

    Static Semantics: IsDestructuring

    `new` NewExpression CallExpression : - MemberExpression Arguments + CoverCallExpressionAndAsyncArrowHead SuperCall CallExpression Arguments CallExpression `[` Expression `]` @@ -11727,7 +11773,7 @@

    Static Semantics: IsValidSimpleAssignmentTarget

    CallExpression : - MemberExpression Arguments + CoverCallExpressionAndAsyncArrowHead SuperCall CallExpression Arguments CallExpression TemplateLiteral @@ -11856,13 +11902,16 @@

    Function Calls

    Runtime Semantics: Evaluation

    - CallExpression : MemberExpression Arguments + CallExpression : CoverCallExpressionAndAsyncArrowHead - 1. Let _ref_ be the result of evaluating |MemberExpression|. + 1. Let _expr_ be CoveredCallExpression of |CoverCallExpressionAndAsyncArrowHead|. + 1. Let _memberExpr_ be the |MemberExpression| of _expr_. + 1. Let _arguments_ be the |Arguments| of _expr_. + 1. Let _ref_ be the result of evaluating _memberExpr_. 1. Let _func_ be ? GetValue(_ref_). 1. If Type(_ref_) is Reference and IsPropertyReference(_ref_) is *false* and GetReferencedName(_ref_) is `"eval"`, then 1. If SameValue(_func_, %eval%) is *true*, then - 1. Let _argList_ be ? ArgumentListEvaluation(|Arguments|). + 1. Let _argList_ be ? ArgumentListEvaluation(_arguments_). 1. If _argList_ has no elements, return *undefined*. 1. Let _evalText_ be the first element of _argList_. 1. If the source code matching this |CallExpression| is strict mode code, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*. @@ -11879,7 +11928,7 @@

    Runtime Semantics: Evaluation

    1. Let _thisValue_ be *undefined*. 1. Let _thisCall_ be this |CallExpression|. 1. Let _tailCall_ be IsInTailPosition(_thisCall_). - 1. Return ? EvaluateDirectCall(_func_, _thisValue_, |Arguments|, _tailCall_). + 1. Return ? EvaluateDirectCall(_func_, _thisValue_, _arguments_, _tailCall_).

    A |CallExpression| evaluation that executes step 3.a.vii is a direct eval.

    CallExpression : CallExpression Arguments @@ -12093,12 +12142,12 @@

    Runtime Semantics: Evaluation

    Update Expressions

    Syntax

    - UpdateExpression[Yield] : - LeftHandSideExpression[?Yield] - LeftHandSideExpression[?Yield] [no LineTerminator here] `++` - LeftHandSideExpression[?Yield] [no LineTerminator here] `--` - `++` UnaryExpression[?Yield] - `--` UnaryExpression[?Yield] + UpdateExpression[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `++` + LeftHandSideExpression[?Yield, ?Await] [no LineTerminator here] `--` + `++` UnaryExpression[?Yield, ?Await] + `--` UnaryExpression[?Yield, ?Await] @@ -12237,15 +12286,16 @@

    Runtime Semantics: Evaluation

    Unary Operators

    Syntax

    - UnaryExpression[Yield] : - UpdateExpression[?Yield] - `delete` UnaryExpression[?Yield] - `void` UnaryExpression[?Yield] - `typeof` UnaryExpression[?Yield] - `+` UnaryExpression[?Yield] - `-` UnaryExpression[?Yield] - `~` UnaryExpression[?Yield] - `!` UnaryExpression[?Yield] + 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] @@ -12261,6 +12311,7 @@

    Static Semantics: IsFunctionDefinition

    `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression + AwaitExpression
    1. Return *false*. @@ -12281,6 +12332,7 @@

    Static Semantics: IsValidSimpleAssignmentTarget

    `-` UnaryExpression `~` UnaryExpression `!` UnaryExpression + AwaitExpression 1. Return *false*. @@ -12551,9 +12603,9 @@

    Exponentiation Operator

    Syntax

    - ExponentiationExpression[Yield] : - UnaryExpression[?Yield] - UpdateExpression[?Yield] `**` ExponentiationExpression[?Yield] + ExponentiationExpression[Yield, Await] : + UnaryExpression[?Yield, ?Await] + UpdateExpression[?Yield, ?Await] `**` ExponentiationExpression[?Yield, ?Await] @@ -12602,9 +12654,9 @@

    Runtime Semantics: Evaluation

    Multiplicative Operators

    Syntax

    - MultiplicativeExpression[Yield] : - ExponentiationExpression[?Yield] - MultiplicativeExpression[?Yield] MultiplicativeOperator ExponentiationExpression[?Yield] + MultiplicativeExpression[Yield, Await] : + ExponentiationExpression[?Yield, ?Await] + MultiplicativeExpression[?Yield, ?Await] MultiplicativeOperator ExponentiationExpression[?Yield, ?Await] MultiplicativeOperator : one of `*` `/` `%` @@ -12778,10 +12830,10 @@

    Applying the `**` Operator

    Additive Operators

    Syntax

    - AdditiveExpression[Yield] : - MultiplicativeExpression[?Yield] - AdditiveExpression[?Yield] `+` MultiplicativeExpression[?Yield] - AdditiveExpression[?Yield] `-` MultiplicativeExpression[?Yield] + AdditiveExpression[Yield, Await] : + MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `+` MultiplicativeExpression[?Yield, ?Await] + AdditiveExpression[?Yield, ?Await] `-` MultiplicativeExpression[?Yield, ?Await] @@ -12910,11 +12962,11 @@

    Applying the Additive Operators to Numbers

    Bitwise Shift Operators

    Syntax

    - ShiftExpression[Yield] : - AdditiveExpression[?Yield] - ShiftExpression[?Yield] `<<` AdditiveExpression[?Yield] - ShiftExpression[?Yield] `>>` AdditiveExpression[?Yield] - ShiftExpression[?Yield] `>>>` AdditiveExpression[?Yield] + ShiftExpression[Yield, Await] : + AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `<<` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>` AdditiveExpression[?Yield, ?Await] + ShiftExpression[?Yield, ?Await] `>>>` AdditiveExpression[?Yield, ?Await] @@ -13028,14 +13080,14 @@

    Relational Operators

    Syntax

    - RelationalExpression[In, Yield] : - ShiftExpression[?Yield] - RelationalExpression[?In, ?Yield] `<` ShiftExpression[?Yield] - RelationalExpression[?In, ?Yield] `>` ShiftExpression[?Yield] - RelationalExpression[?In, ?Yield] `<=` ShiftExpression[?Yield] - RelationalExpression[?In, ?Yield] `>=` ShiftExpression[?Yield] - RelationalExpression[?In, ?Yield] `instanceof` ShiftExpression[?Yield] - [+In] RelationalExpression[+In, ?Yield] `in` ShiftExpression[?Yield] + RelationalExpression[In, Yield, Await] : + ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `<=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `>=` ShiftExpression[?Yield, ?Await] + RelationalExpression[?In, ?Yield, ?Await] `instanceof` ShiftExpression[?Yield, ?Await] + [+In] RelationalExpression[+In, ?Yield, ?Await] `in` ShiftExpression[?Yield, ?Await]

    The [In] grammar parameter is needed to avoid confusing the `in` operator in a relational expression with the `in` operator in a `for` statement.

    @@ -13165,12 +13217,12 @@

    Equality Operators

    Syntax

    - EqualityExpression[In, Yield] : - RelationalExpression[?In, ?Yield] - EqualityExpression[?In, ?Yield] `==` RelationalExpression[?In, ?Yield] - EqualityExpression[?In, ?Yield] `!=` RelationalExpression[?In, ?Yield] - EqualityExpression[?In, ?Yield] `===` RelationalExpression[?In, ?Yield] - EqualityExpression[?In, ?Yield] `!==` RelationalExpression[?In, ?Yield] + EqualityExpression[In, Yield, Await] : + RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `==` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!=` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `===` RelationalExpression[?In, ?Yield, ?Await] + EqualityExpression[?In, ?Yield, ?Await] `!==` RelationalExpression[?In, ?Yield, ?Await] @@ -13289,17 +13341,17 @@

    Runtime Semantics: Evaluation

    Binary Bitwise Operators

    Syntax

    - BitwiseANDExpression[In, Yield] : - EqualityExpression[?In, ?Yield] - BitwiseANDExpression[?In, ?Yield] `&` EqualityExpression[?In, ?Yield] + BitwiseANDExpression[In, Yield, Await] : + EqualityExpression[?In, ?Yield, ?Await] + BitwiseANDExpression[?In, ?Yield, ?Await] `&` EqualityExpression[?In, ?Yield, ?Await] - BitwiseXORExpression[In, Yield] : - BitwiseANDExpression[?In, ?Yield] - BitwiseXORExpression[?In, ?Yield] `^` BitwiseANDExpression[?In, ?Yield] + BitwiseXORExpression[In, Yield, Await] : + BitwiseANDExpression[?In, ?Yield, ?Await] + BitwiseXORExpression[?In, ?Yield, ?Await] `^` BitwiseANDExpression[?In, ?Yield, ?Await] - BitwiseORExpression[In, Yield] : - BitwiseXORExpression[?In, ?Yield] - BitwiseORExpression[?In, ?Yield] `|` BitwiseXORExpression[?In, ?Yield] + BitwiseORExpression[In, Yield, Await] : + BitwiseXORExpression[?In, ?Yield, ?Await] + BitwiseORExpression[?In, ?Yield, ?Await] `|` BitwiseXORExpression[?In, ?Yield, ?Await] @@ -13355,13 +13407,13 @@

    Runtime Semantics: Evaluation

    Binary Logical Operators

    Syntax

    - LogicalANDExpression[In, Yield] : - BitwiseORExpression[?In, ?Yield] - LogicalANDExpression[?In, ?Yield] `&&` BitwiseORExpression[?In, ?Yield] + LogicalANDExpression[In, Yield, Await] : + BitwiseORExpression[?In, ?Yield, ?Await] + LogicalANDExpression[?In, ?Yield, ?Await] `&&` BitwiseORExpression[?In, ?Yield, ?Await] - LogicalORExpression[In, Yield] : - LogicalANDExpression[?In, ?Yield] - LogicalORExpression[?In, ?Yield] `||` LogicalANDExpression[?In, ?Yield] + LogicalORExpression[In, Yield, Await] : + LogicalANDExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `||` LogicalANDExpression[?In, ?Yield, ?Await]

    The value produced by a `&&` or `||` operator is not necessarily of type Boolean. The value produced will always be the value of one of the two operand expressions.

    @@ -13424,9 +13476,9 @@

    Runtime Semantics: Evaluation

    Conditional Operator ( `? :` )

    Syntax

    - ConditionalExpression[In, Yield] : - LogicalORExpression[?In, ?Yield] - LogicalORExpression[?In, ?Yield] `?` AssignmentExpression[+In, ?Yield] `:` AssignmentExpression[?In, ?Yield] + ConditionalExpression[In, Yield, Await] : + LogicalORExpression[?In, ?Yield, ?Await] + LogicalORExpression[?In, ?Yield, ?Await] `?` AssignmentExpression[+In, ?Yield, ?Await] `:` AssignmentExpression[?In, ?Yield, ?Await]

    The grammar for a |ConditionalExpression| in ECMAScript is slightly different from that in C and Java, which each allow the second subexpression to be an |Expression| but restrict the third expression to be a |ConditionalExpression|. The motivation for this difference in ECMAScript is to allow an assignment expression to be governed by either arm of a conditional and to eliminate the confusing and fairly useless case of a comma expression as the centre expression.

    @@ -13474,12 +13526,13 @@

    Runtime Semantics: Evaluation

    Assignment Operators

    Syntax

    - AssignmentExpression[In, Yield] : - ConditionalExpression[?In, ?Yield] - [+Yield] YieldExpression[?In] - ArrowFunction[?In, ?Yield] - LeftHandSideExpression[?Yield] `=` AssignmentExpression[?In, ?Yield] #assignment - LeftHandSideExpression[?Yield] AssignmentOperator AssignmentExpression[?In, ?Yield] + AssignmentExpression[In, Yield, Await] : + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield] YieldExpression[?In, ?Await] + [+Await] AwaitExpression[?In, ?Yield] + ArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] AssignmentOperator : one of `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` @@ -13509,7 +13562,11 @@

    Static Semantics: Early Errors

    Static Semantics: IsFunctionDefinition

    - AssignmentExpression : ArrowFunction + + AssignmentExpression : + ArrowFunction + AsyncArrowFunction + 1. Return *true*. @@ -13532,6 +13589,7 @@

    Static Semantics: IsValidSimpleAssignmentTarget

    AssignmentExpression : YieldExpression ArrowFunction + AsyncArrowFunction LeftHandSideExpression `=` AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression
    @@ -13543,7 +13601,7 @@

    Static Semantics: IsValidSimpleAssignmentTarget

    Runtime Semantics: Evaluation

    - AssignmentExpression[In, Yield] : LeftHandSideExpression[?Yield] `=` AssignmentExpression[?In, ?Yield] + AssignmentExpression[In, Yield, Await] : LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] 1. If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be the result of evaluating |LeftHandSideExpression|. @@ -13584,43 +13642,43 @@

    Destructuring Assignment

    Supplemental Syntax

    In certain circumstances when processing the production AssignmentExpression : LeftHandSideExpression `=` AssignmentExpression the following grammar is used to refine the interpretation of |LeftHandSideExpression|.

    - AssignmentPattern[Yield] : - ObjectAssignmentPattern[?Yield] - ArrayAssignmentPattern[?Yield] + AssignmentPattern[Yield, Await] : + ObjectAssignmentPattern[?Yield, ?Await] + ArrayAssignmentPattern[?Yield, ?Await] - ObjectAssignmentPattern[Yield] : + ObjectAssignmentPattern[Yield, Await] : `{` `}` - `{` AssignmentPropertyList[?Yield] `}` - `{` AssignmentPropertyList[?Yield] `,` `}` + `{` AssignmentPropertyList[?Yield, ?Await] `}` + `{` AssignmentPropertyList[?Yield, ?Await] `,` `}` - ArrayAssignmentPattern[Yield] : - `[` Elision? AssignmentRestElement[?Yield]? `]` - `[` AssignmentElementList[?Yield] `]` - `[` AssignmentElementList[?Yield] `,` Elision? AssignmentRestElement[?Yield]? `]` + ArrayAssignmentPattern[Yield, Await] : + `[` Elision? AssignmentRestElement[?Yield, ?Await]? `]` + `[` AssignmentElementList[?Yield, ?Await] `]` + `[` AssignmentElementList[?Yield, ?Await] `,` Elision? AssignmentRestElement[?Yield, ?Await]? `]` - AssignmentPropertyList[Yield] : - AssignmentProperty[?Yield] - AssignmentPropertyList[?Yield] `,` AssignmentProperty[?Yield] + AssignmentPropertyList[Yield, Await] : + AssignmentProperty[?Yield, ?Await] + AssignmentPropertyList[?Yield, ?Await] `,` AssignmentProperty[?Yield, ?Await] - AssignmentElementList[Yield] : - AssignmentElisionElement[?Yield] - AssignmentElementList[?Yield] `,` AssignmentElisionElement[?Yield] + AssignmentElementList[Yield, Await] : + AssignmentElisionElement[?Yield, ?Await] + AssignmentElementList[?Yield, ?Await] `,` AssignmentElisionElement[?Yield, ?Await] - AssignmentElisionElement[Yield] : - Elision? AssignmentElement[?Yield] + AssignmentElisionElement[Yield, Await] : + Elision? AssignmentElement[?Yield, ?Await] AssignmentProperty[Yield] : IdentifierReference[?Yield] Initializer[+In, ?Yield]? PropertyName[?Yield] `:` AssignmentElement[?Yield] - AssignmentElement[Yield] : - DestructuringAssignmentTarget[?Yield] Initializer[+In, ?Yield]? + AssignmentElement[Yield, Await] : + DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? - AssignmentRestElement[Yield] : - `...` DestructuringAssignmentTarget[?Yield] + AssignmentRestElement[Yield, Await] : + `...` DestructuringAssignmentTarget[?Yield, ?Await] - DestructuringAssignmentTarget[Yield] : - LeftHandSideExpression[?Yield] + DestructuringAssignmentTarget[Yield, Await] : + LeftHandSideExpression[?Yield, ?Await] @@ -13780,7 +13838,7 @@

    Runtime Semantics: IteratorDestructuringAssignmentEvaluation

    1. If _next_ is *false*, set _iteratorRecord_.[[Done]] to *true*. 1. Return NormalCompletion(~empty~).
    - AssignmentElement[Yield] : DestructuringAssignmentTarget Initializer? + AssignmentElement[Yield, Await] : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be the result of evaluating |DestructuringAssignmentTarget|. @@ -13800,7 +13858,7 @@

    Runtime Semantics: IteratorDestructuringAssignmentEvaluation

    1. Let _v_ be ? GetValue(_defaultValue_). 1. Else, let _v_ be _value_. 1. If |DestructuringAssignmentTarget| is an |ObjectLiteral| or an |ArrayLiteral|, then - 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using either |AssignmentPattern[~Yield]| or |AssignmentPattern[+Yield]| as the goal symbol depending upon whether this |AssignmentElement| has the [Yield] parameter. + 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |DestructuringAssignmentTarget|. 1. Return the result of performing DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with _v_ as the argument. 1. If |Initializer| is present and _value_ is *undefined* and IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then 1. Let _hasNameProperty_ be ? HasOwnProperty(_v_, `"name"`). @@ -13810,7 +13868,7 @@

    Runtime Semantics: IteratorDestructuringAssignmentEvaluation

    Left to right evaluation order is maintained by evaluating a |DestructuringAssignmentTarget| that is not a destructuring pattern prior to accessing the iterator or evaluating the |Initializer|.

    - AssignmentRestElement[Yield] : `...` DestructuringAssignmentTarget + AssignmentRestElement[Yield, Await] : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be the result of evaluating |DestructuringAssignmentTarget|. @@ -13831,7 +13889,7 @@

    Runtime Semantics: IteratorDestructuringAssignmentEvaluation

    1. Increment _n_ by 1. 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Return ? PutValue(_lref_, _A_). - 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using either |AssignmentPattern[~Yield]| or |AssignmentPattern[+Yield]| as the goal symbol depending upon whether this |AssignmentRestElement| has the [Yield] parameter. + 1. Let _nestedAssignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |AssignmentRestElement|. 1. Return the result of performing DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with _A_ as the argument.
    @@ -13840,7 +13898,7 @@

    Runtime Semantics: IteratorDestructuringAssignmentEvaluation

    Runtime Semantics: KeyedDestructuringAssignmentEvaluation

    with parameters _value_ and _propertyName_

    - AssignmentElement[Yield] : DestructuringAssignmentTarget Initializer? + AssignmentElement[Yield, Await] : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be the result of evaluating |DestructuringAssignmentTarget|. @@ -13851,7 +13909,7 @@

    Runtime Semantics: KeyedDestructuringAssignmentEvaluation

    1. Let _rhsValue_ be ? GetValue(_defaultValue_). 1. Else, let _rhsValue_ be _v_. 1. If |DestructuringAssignmentTarget| is an |ObjectLiteral| or an |ArrayLiteral|, then - 1. Let _assignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using either |AssignmentPattern[~Yield]| or |AssignmentPattern[+Yield]| as the goal symbol depending upon whether this |AssignmentElement| has the [Yield] parameter. + 1. Let _assignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |DestructuringAssignmentTarget|. 1. Return the result of performing DestructuringAssignmentEvaluation of _assignmentPattern_ with _rhsValue_ as the argument. 1. If |Initializer| is present and _v_ is *undefined* and IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then 1. Let _hasNameProperty_ be ? HasOwnProperty(_rhsValue_, `"name"`). @@ -13867,9 +13925,9 @@

    Runtime Semantics: KeyedDestructuringAssignmentEvaluation

    Comma Operator ( `,` )

    Syntax

    - Expression[In, Yield] : - AssignmentExpression[?In, ?Yield] - Expression[?In, ?Yield] `,` AssignmentExpression[?In, ?Yield] + Expression[In, Yield, Await] : + AssignmentExpression[?In, ?Yield, ?Await] + Expression[?In, ?Yield, ?Await] `,` AssignmentExpression[?In, ?Yield, ?Await] @@ -13914,34 +13972,35 @@

    Runtime Semantics: Evaluation

    ECMAScript Language: Statements and Declarations

    Syntax

    - Statement[Yield, Return] : - BlockStatement[?Yield, ?Return] - VariableStatement[?Yield] + Statement[Yield, Await, Return] : + BlockStatement[?Yield, ?Await, ?Return] + VariableStatement[?Yield, ?Await] EmptyStatement - ExpressionStatement[?Yield] - IfStatement[?Yield, ?Return] - BreakableStatement[?Yield, ?Return] - ContinueStatement[?Yield] - BreakStatement[?Yield] - [+Return] ReturnStatement[?Yield] - WithStatement[?Yield, ?Return] - LabelledStatement[?Yield, ?Return] - ThrowStatement[?Yield] - TryStatement[?Yield, ?Return] + ExpressionStatement[?Yield, ?Await] + IfStatement[?Yield, ?Await, ?Return] + BreakableStatement[?Yield, ?Await, ?Return] + ContinueStatement[?Yield, ?Await] + BreakStatement[?Yield, ?Await] + [+Return] ReturnStatement[?Yield, ?Await] + WithStatement[?Yield, ?Await, ?Return] + LabelledStatement[?Yield, ?Await, ?Return] + ThrowStatement[?Yield, ?Await] + TryStatement[?Yield, ?Await, ?Return] DebuggerStatement - Declaration[Yield] : - HoistableDeclaration[?Yield, ~Default] - ClassDeclaration[?Yield, ~Default] - LexicalDeclaration[+In, ?Yield] + Declaration[Yield, Await] : + HoistableDeclaration[?Yield, ?Await, ~Default] + ClassDeclaration[?Yield, ?Await, ~Default] + LexicalDeclaration[+In, ?Yield, ?Await] - HoistableDeclaration[Yield, Default] : - FunctionDeclaration[?Yield, ?Default] - GeneratorDeclaration[?Yield, ?Default] + HoistableDeclaration[Yield, Await, Default] : + FunctionDeclaration[?Yield, ?Await, ?Default] + GeneratorDeclaration[?Yield, ?Await, ?Default] + AsyncFunctionDeclaration[?Yield, ?Await, ?Default] - BreakableStatement[Yield, Return] : - IterationStatement[?Yield, ?Return] - SwitchStatement[?Yield, ?Return] + BreakableStatement[Yield, Await, Return] : + IterationStatement[?Yield, ?Await, ?Return] + SwitchStatement[?Yield, ?Await, ?Return] @@ -14025,6 +14084,10 @@

    Static Semantics: DeclarationPart

    1. Return |GeneratorDeclaration|. + HoistableDeclaration : AsyncFunctionDeclaration + + 1. Return |AsyncFunctionDeclaration|. + Declaration : ClassDeclaration 1. Return |ClassDeclaration|. @@ -14105,15 +14168,19 @@

    Runtime Semantics: LabelledEvaluation

    Runtime Semantics: Evaluation

    - HoistableDeclaration : - GeneratorDeclaration + HoistableDeclaration : GeneratorDeclaration 1. Return NormalCompletion(~empty~). - HoistableDeclaration : - FunctionDeclaration + HoistableDeclaration : AsyncFunctionDeclaration + + + 1. Return NormalCompletion(~empty~). + + + HoistableDeclaration : FunctionDeclaration 1. Return the result of evaluating |FunctionDeclaration|. @@ -14135,19 +14202,19 @@

    Runtime Semantics: Evaluation

    Block

    Syntax

    - BlockStatement[Yield, Return] : - Block[?Yield, ?Return] + BlockStatement[Yield, Await, Return] : + Block[?Yield, ?Await, ?Return] - Block[Yield, Return] : - `{` StatementList[?Yield, ?Return]? `}` + Block[Yield, Await, Return] : + `{` StatementList[?Yield, ?Await, ?Return]? `}` - StatementList[Yield, Return] : - StatementListItem[?Yield, ?Return] - StatementList[?Yield, ?Return] StatementListItem[?Yield, ?Return] + StatementList[Yield, Await, Return] : + StatementListItem[?Yield, ?Await, ?Return] + StatementList[?Yield, ?Await, ?Return] StatementListItem[?Yield, ?Await, ?Return] - StatementListItem[Yield, Return] : - Statement[?Yield, ?Return] - Declaration[?Yield] + StatementListItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + Declaration[?Yield, ?Await] @@ -14501,20 +14568,20 @@

    Let and Const Declarations

    Syntax

    - LexicalDeclaration[In, Yield] : - LetOrConst BindingList[?In, ?Yield] `;` + LexicalDeclaration[In, Yield, Await] : + LetOrConst BindingList[?In, ?Yield, ?Await] `;` LetOrConst : `let` `const` - BindingList[In, Yield] : - LexicalBinding[?In, ?Yield] - BindingList[?In, ?Yield] `,` LexicalBinding[?In, ?Yield] + BindingList[In, Yield, Await] : + LexicalBinding[?In, ?Yield, ?Await] + BindingList[?In, ?Yield, ?Await] `,` LexicalBinding[?In, ?Yield, ?Await] - LexicalBinding[In, Yield] : - BindingIdentifier[?Yield] Initializer[?In, ?Yield]? - BindingPattern[?Yield] Initializer[?In, ?Yield] + LexicalBinding[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] @@ -14631,16 +14698,16 @@

    Variable Statement

    Syntax

    - VariableStatement[Yield] : - `var` VariableDeclarationList[+In, ?Yield] `;` + VariableStatement[Yield, Await] : + `var` VariableDeclarationList[+In, ?Yield, ?Await] `;` - VariableDeclarationList[In, Yield] : - VariableDeclaration[?In, ?Yield] - VariableDeclarationList[?In, ?Yield] `,` VariableDeclaration[?In, ?Yield] + VariableDeclarationList[In, Yield, Await] : + VariableDeclaration[?In, ?Yield, ?Await] + VariableDeclarationList[?In, ?Yield, ?Await] `,` VariableDeclaration[?In, ?Yield, ?Await] - VariableDeclaration[In, Yield] : - BindingIdentifier[?Yield] Initializer[?In, ?Yield]? - BindingPattern[?Yield] Initializer[?In, ?Yield] + VariableDeclaration[In, Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[?In, ?Yield, ?Await]? + BindingPattern[?Yield, ?Await] Initializer[?In, ?Yield, ?Await] @@ -14736,45 +14803,45 @@

    Runtime Semantics: Evaluation

    Destructuring Binding Patterns

    Syntax

    - BindingPattern[Yield] : - ObjectBindingPattern[?Yield] - ArrayBindingPattern[?Yield] + BindingPattern[Yield, Await] : + ObjectBindingPattern[?Yield, ?Await] + ArrayBindingPattern[?Yield, ?Await] - ObjectBindingPattern[Yield] : + ObjectBindingPattern[Yield, Await] : `{` `}` - `{` BindingPropertyList[?Yield] `}` - `{` BindingPropertyList[?Yield] `,` `}` + `{` BindingPropertyList[?Yield, ?Await] `}` + `{` BindingPropertyList[?Yield, ?Await] `,` `}` - ArrayBindingPattern[Yield] : - `[` Elision? BindingRestElement[?Yield]? `]` - `[` BindingElementList[?Yield] `]` - `[` BindingElementList[?Yield] `,` Elision? BindingRestElement[?Yield]? `]` + ArrayBindingPattern[Yield, Await] : + `[` Elision? BindingRestElement[?Yield, ?Await]? `]` + `[` BindingElementList[?Yield, ?Await] `]` + `[` BindingElementList[?Yield, ?Await] `,` Elision? BindingRestElement[?Yield, ?Await]? `]` - BindingPropertyList[Yield] : - BindingProperty[?Yield] - BindingPropertyList[?Yield] `,` BindingProperty[?Yield] + BindingPropertyList[Yield, Await] : + BindingProperty[?Yield, ?Await] + BindingPropertyList[?Yield, ?Await] `,` BindingProperty[?Yield, ?Await] - BindingElementList[Yield] : - BindingElisionElement[?Yield] - BindingElementList[?Yield] `,` BindingElisionElement[?Yield] + BindingElementList[Yield, Await] : + BindingElisionElement[?Yield, ?Await] + BindingElementList[?Yield, ?Await] `,` BindingElisionElement[?Yield, ?Await] - BindingElisionElement[Yield] : - Elision? BindingElement[?Yield] + BindingElisionElement[Yield, Await] : + Elision? BindingElement[?Yield, ?Await] - BindingProperty[Yield] : - SingleNameBinding[?Yield] - PropertyName[?Yield] `:` BindingElement[?Yield] + BindingProperty[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + PropertyName[?Yield, ?Await] `:` BindingElement[?Yield, ?Await] - BindingElement[Yield] : - SingleNameBinding[?Yield] - BindingPattern[?Yield] Initializer[+In, ?Yield]? + BindingElement[Yield, Await] : + SingleNameBinding[?Yield, ?Await] + BindingPattern[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? - SingleNameBinding[Yield] : - BindingIdentifier[?Yield] Initializer[+In, ?Yield]? + SingleNameBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? - BindingRestElement[Yield] : - `...` BindingIdentifier[?Yield] - `...` BindingPattern[?Yield] + BindingRestElement[Yield, Await] : + `...` BindingIdentifier[?Yield, ?Await] + `...` BindingPattern[?Yield, ?Await] @@ -15200,11 +15267,11 @@

    Runtime Semantics: Evaluation

    Expression Statement

    Syntax

    - ExpressionStatement[Yield] : - [lookahead <! {`{`, `function`, `class`, `let [`}] Expression[+In, ?Yield] `;` + ExpressionStatement[Yield, Await] : + [lookahead <! {`{`, `function`, `async` [no |LineTerminator| here] `function`, `class`, `let [`}] Expression[+In, ?Yield] `;` -

    An |ExpressionStatement| cannot start with a U+007B (LEFT CURLY BRACKET) because that might make it ambiguous with a |Block|. Also, an |ExpressionStatement| cannot start with the `function` or `class` keywords because that would make it ambiguous with a |FunctionDeclaration|, a |GeneratorDeclaration|, or a |ClassDeclaration|. An |ExpressionStatement| cannot start with the two token sequence `let [` because that would make it ambiguous with a `let` |LexicalDeclaration| whose first |LexicalBinding| was an |ArrayBindingPattern|.

    +

    An |ExpressionStatement| cannot start with a U+007B (LEFT CURLY BRACKET) because that might make it ambiguous with a |Block|. An |ExpressionStatement| cannot start with the `function` or `class` keywords because that would make it ambiguous with a |FunctionDeclaration|, a |GeneratorDeclaration|, or a |ClassDeclaration|. An |ExpressionStatement| cannot start with `async function` because that would make it ambiguous with an |AsyncFunctionExpression|. An |ExpressionStatement| cannot start with the two token sequence `let [` because that would make it ambiguous with a `let` |LexicalDeclaration| whose first |LexicalBinding| was an |ArrayBindingPattern|.

    @@ -15223,9 +15290,9 @@

    Runtime Semantics: Evaluation

    The `if` Statement

    Syntax

    - IfStatement[Yield, Return] : - `if` `(` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] `else` Statement[?Yield, ?Return] - `if` `(` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] + IfStatement[Yield, Await, Return] : + `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `else` Statement[?Yield, ?Await, ?Return] + `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]

    Each `else` for which the choice of associated `if` is ambiguous shall be associated with the nearest possible `if` that would otherwise have no corresponding `else`.

    @@ -15361,25 +15428,25 @@

    Runtime Semantics: Evaluation

    Iteration Statements

    Syntax

    - IterationStatement[Yield, Return] : - `do` Statement[?Yield, ?Return] `while` `(` Expression[+In, ?Yield] `)` `;` - `while` `(` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` [lookahead <! {`let [`}] Expression[~In, ?Yield]? `;` Expression[+In, ?Yield]? `;` Expression[+In, ?Yield]? `)` Statement[?Yield, ?Return] - `for` `(` `var` VariableDeclarationList[~In, ?Yield] `;` Expression[+In, ?Yield]? `;` Expression[+In, ?Yield]? `)` Statement[?Yield, ?Return] - `for` `(` LexicalDeclaration[~In, ?Yield] Expression[+In, ?Yield]? `;` Expression[+In, ?Yield]? `)` Statement[?Yield, ?Return] - `for` `(` [lookahead <! {`let [`}] LeftHandSideExpression[?Yield] `in` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` `var` ForBinding[?Yield] `in` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` ForDeclaration[?Yield] `in` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` [lookahead != `let` ] LeftHandSideExpression[?Yield] `of` AssignmentExpression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` `var` ForBinding[?Yield] `of` AssignmentExpression[+In, ?Yield] `)` Statement[?Yield, ?Return] - `for` `(` ForDeclaration[?Yield] `of` AssignmentExpression[+In, ?Yield] `)` Statement[?Yield, ?Return] - - ForDeclaration[Yield] : - LetOrConst ForBinding[?Yield] - - ForBinding[Yield] : - BindingIdentifier[?Yield] - BindingPattern[?Yield] + IterationStatement[Yield, Await, Return] : + `do` Statement[?Yield, ?Await, ?Return] `while` `(` Expression[+In, ?Yield, ?Await] `)` `;` + `while` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` [lookahead <! {`let [`}] Expression[~In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` VariableDeclarationList[~In, ?Yield, ?Await] `;` Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + `for` `(` LexicalDeclaration[~In, ?Yield, ?Await] Expression[+In, ?Yield, ?Await]? `;` Expression[+In, ?Yield, ?Await]? `)` Statement[?Yield, ?Await, ?Return] + `for` `(` [lookahead <! {`let [`}] LeftHandSideExpression[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` ForDeclaration[?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` [lookahead != `let` ] LeftHandSideExpression[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` `var` ForBinding[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + `for` `(` ForDeclaration[?Yield, ?Await] `of` AssignmentExpression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] + + ForDeclaration[Yield, Await] : + LetOrConst ForBinding[?Yield, ?Await] + + ForBinding[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + BindingPattern[?Yield, ?Await]

    This section is extended by Annex .

    @@ -16194,9 +16261,9 @@

    EnumerateObjectProperties (_O_)

    The `continue` Statement

    Syntax

    - ContinueStatement[Yield] : + ContinueStatement[Yield, Await] : `continue` `;` - `continue` [no LineTerminator here] LabelIdentifier[?Yield] `;` + `continue` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` @@ -16250,9 +16317,9 @@

    Runtime Semantics: Evaluation

    The `break` Statement

    Syntax

    - BreakStatement[Yield] : + BreakStatement[Yield, Await] : `break` `;` - `break` [no LineTerminator here] LabelIdentifier[?Yield] `;` + `break` [no LineTerminator here] LabelIdentifier[?Yield, ?Await] `;` @@ -16302,9 +16369,9 @@

    Runtime Semantics: Evaluation

    The `return` Statement

    Syntax

    - ReturnStatement[Yield] : + ReturnStatement[Yield, Await] : `return` `;` - `return` [no LineTerminator here] Expression[+In, ?Yield] `;` + `return` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;`

    A `return` statement causes a function to cease execution and return a value to the caller. If |Expression| is omitted, the return value is *undefined*. Otherwise, the return value is the value of |Expression|.

    @@ -16331,8 +16398,8 @@

    Runtime Semantics: Evaluation

    The `with` Statement

    Syntax

    - WithStatement[Yield, Return] : - `with` `(` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] + WithStatement[Yield, Await, Return] : + `with` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]

    The `with` statement adds an object Environment Record for a computed object to the lexical environment of the running execution context. It then executes a statement using this augmented lexical environment. Finally, it restores the original lexical environment.

    @@ -16434,22 +16501,22 @@

    Runtime Semantics: Evaluation

    The `switch` Statement

    Syntax

    - SwitchStatement[Yield, Return] : - `switch` `(` Expression[+In, ?Yield] `)` CaseBlock[?Yield, ?Return] + SwitchStatement[Yield, Await, Return] : + `switch` `(` Expression[+In, ?Yield, ?Await] `)` CaseBlock[?Yield, ?Await, ?Return] - CaseBlock[Yield, Return] : - `{` CaseClauses[?Yield, ?Return]? `}` - `{` CaseClauses[?Yield, ?Return]? DefaultClause[?Yield, ?Return] CaseClauses[?Yield, ?Return]? `}` + CaseBlock[Yield, Await, Return] : + `{` CaseClauses[?Yield, ?Await, ?Return]? `}` + `{` CaseClauses[?Yield, ?Await, ?Return]? DefaultClause[?Yield, ?Await, ?Return] CaseClauses[?Yield, ?Await, ?Return]? `}` - CaseClauses[Yield, Return] : - CaseClause[?Yield, ?Return] - CaseClauses[?Yield, ?Return] CaseClause[?Yield, ?Return] + CaseClauses[Yield, Await, Return] : + CaseClause[?Yield, ?Await, ?Return] + CaseClauses[?Yield, ?Await, ?Return] CaseClause[?Yield, ?Await, ?Return] - CaseClause[Yield, Return] : - `case` Expression[+In, ?Yield] `:` StatementList[?Yield, ?Return]? + CaseClause[Yield, Await, Return] : + `case` Expression[+In, ?Yield, ?Await] `:` StatementList[?Yield, ?Await, ?Return]? - DefaultClause[Yield, Return] : - `default` `:` StatementList[?Yield, ?Return]? + DefaultClause[Yield, Await, Return] : + `default` `:` StatementList[?Yield, ?Await, ?Return]? @@ -16850,12 +16917,12 @@

    Runtime Semantics: Evaluation

    Labelled Statements

    Syntax

    - LabelledStatement[Yield, Return] : - LabelIdentifier[?Yield] `:` LabelledItem[?Yield, ?Return] + LabelledStatement[Yield, Await, Return] : + LabelIdentifier[?Yield, ?Await] `:` LabelledItem[?Yield, ?Await, ?Return] - LabelledItem[Yield, Return] : - Statement[?Yield, ?Return] - FunctionDeclaration[?Yield, ~Default] + LabelledItem[Yield, Await, Return] : + Statement[?Yield, ?Await, ?Return] + FunctionDeclaration[?Yield, ?Await, ~Default]

    A |Statement| may be prefixed by a label. Labelled statements are only used in conjunction with labelled `break` and `continue` statements. ECMAScript has no `goto` statement. A |Statement| can be part of a |LabelledStatement|, which itself can be part of a |LabelledStatement|, and so on. The labels introduced this way are collectively referred to as the “current label set” when describing the semantics of individual statements.

    @@ -17105,8 +17172,8 @@

    Runtime Semantics: Evaluation

    The `throw` Statement

    Syntax

    - ThrowStatement[Yield] : - `throw` [no LineTerminator here] Expression[+In, ?Yield] `;` + ThrowStatement[Yield, Await] : + `throw` [no LineTerminator here] Expression[+In, ?Yield, ?Await] `;` @@ -17126,20 +17193,20 @@

    Runtime Semantics: Evaluation

    The `try` Statement

    Syntax

    - TryStatement[Yield, Return] : - `try` Block[?Yield, ?Return] Catch[?Yield, ?Return] - `try` Block[?Yield, ?Return] Finally[?Yield, ?Return] - `try` Block[?Yield, ?Return] Catch[?Yield, ?Return] Finally[?Yield, ?Return] + TryStatement[Yield, Await, Return] : + `try` Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] + `try` Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return] + `try` Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return] - Catch[Yield, Return] : - `catch` `(` CatchParameter[?Yield] `)` Block[?Yield, ?Return] + Catch[Yield, Await, Return] : + `catch` `(` CatchParameter[?Yield, ?Await] `)` Block[?Yield, ?Await, ?Return] - Finally[Yield, Return] : - `finally` Block[?Yield, ?Return] + Finally[Yield, Await, Return] : + `finally` Block[?Yield, ?Await, ?Return] - CatchParameter[Yield] : - BindingIdentifier[?Yield] - BindingPattern[?Yield] + CatchParameter[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + BindingPattern[?Yield, ?Await]

    The `try` statement encloses a block of code in which an exceptional condition can occur, such as a runtime error or a `throw` statement. The `catch` clause provides the exception-handling code. When a catch clause catches an exception, its |CatchParameter| is bound to that exception.

    @@ -17410,38 +17477,38 @@

    ECMAScript Language: Functions and Classes

    Function Definitions

    Syntax

    - FunctionDeclaration[Yield, Default] : - `function` BindingIdentifier[?Yield] `(` FormalParameters[~Yield] `)` `{` FunctionBody[~Yield] `}` - [+Default] `function` `(` FormalParameters[~Yield] `)` `{` FunctionBody[~Yield] `}` + FunctionDeclaration[Yield, Await, Default] : + `function` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + [+Default] `function` `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` FunctionExpression : - `function` BindingIdentifier[~Yield]? `(` FormalParameters[~Yield] `)` `{` FunctionBody[~Yield] `}` + `function` BindingIdentifier[~Yield, ~Await]? `(` FormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` - UniqueFormalParameters[Yield] : - FormalParameters[?Yield] + UniqueFormalParameters[Yield, Await] : + FormalParameters[?Yield, ?Await] - FormalParameters[Yield] : + FormalParameters[Yield, Await] : [empty] - FunctionRestParameter[?Yield] - FormalParameterList[?Yield] - FormalParameterList[?Yield] `,` - FormalParameterList[?Yield] `,` FunctionRestParameter[?Yield] + FunctionRestParameter[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] `,` + FormalParameterList[?Yield, ?Await] `,` FunctionRestParameter[?Yield, ?Await] - FormalParameterList[Yield] : - FormalParameter[?Yield] - FormalParameterList[?Yield] `,` FormalParameter[?Yield] + FormalParameterList[Yield, Await] : + FormalParameter[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] `,` FormalParameter[?Yield, ?Await] - FunctionRestParameter[Yield] : - BindingRestElement[?Yield] + FunctionRestParameter[Yield, Await] : + BindingRestElement[?Yield, ?Await] - FormalParameter[Yield] : - BindingElement[?Yield] + FormalParameter[Yield, Await] : + BindingElement[?Yield, ?Await] - FunctionBody[Yield] : - FunctionStatementList[?Yield] + FunctionBody[Yield, Await] : + FunctionStatementList[?Yield, ?Await] - FunctionStatementList[Yield] : - StatementList[?Yield, +Return]? + FunctionStatementList[Yield, Await] : + StatementList[?Yield, ?Await, +Return]? @@ -17927,26 +17994,26 @@

    Runtime Semantics: Evaluation

    Arrow Function Definitions

    Syntax

    - ArrowFunction[In, Yield] : - ArrowParameters[?Yield] [no LineTerminator here] `=>` ConciseBody[?In] + ArrowFunction[In, Yield, Await] : + ArrowParameters[?Yield, ?Await] [no LineTerminator here] `=>` ConciseBody[?In] - ArrowParameters[Yield] : - BindingIdentifier[?Yield] - CoverParenthesizedExpressionAndArrowParameterList[?Yield] #parencover + ArrowParameters[Yield, Await] : + BindingIdentifier[?Yield, ?Await] + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover ConciseBody[In] : - [lookahead != `{` ] AssignmentExpression[?In, ~Yield] - `{` FunctionBody[~Yield] `}` + [lookahead != `{` ] AssignmentExpression[?In, ~Yield, ~Await] + `{` FunctionBody[~Yield, ~Await] `}`

    Supplemental Syntax

    When the production
    - ArrowParameters[Yield] : CoverParenthesizedExpressionAndArrowParameterList[?Yield] + ArrowParameters[Yield, Await] : CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
    is recognized the following grammar is used to refine the interpretation of |CoverParenthesizedExpressionAndArrowParameterList|:

    - ArrowFormalParameters[Yield] : - `(` UniqueFormalParameters[?Yield] `)` + ArrowFormalParameters[Yield, Await] : + `(` UniqueFormalParameters[?Yield, ?Await] `)` @@ -17957,6 +18024,9 @@

    Static Semantics: Early Errors

  • It is a Syntax Error if |ArrowParameters| Contains |YieldExpression| is *true*.
  • +
  • + It is a Syntax Error if |ArrowParameters| Contains |AwaitExpression| is *true*. +
  • It is a Syntax Error if ContainsUseStrict of |ConciseBody| is *true* and IsSimpleParameterList of |ArrowParameters| is *false*.
  • @@ -17964,16 +18034,13 @@

    Static Semantics: Early Errors

    It is a Syntax Error if any element of the BoundNames of |ArrowParameters| also occurs in the LexicallyDeclaredNames of |ConciseBody|.
- ArrowParameters[Yield] : CoverParenthesizedExpressionAndArrowParameterList[?Yield] + ArrowParameters[Yield, Await] : CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
  • - If the [Yield] grammar parameter is present on |ArrowParameters|, it is a Syntax Error if the lexical token sequence matched by |CoverParenthesizedExpressionAndArrowParameterList[?Yield]| cannot be parsed with no tokens left over using |ArrowFormalParameters[+Yield]| as the goal symbol. -
  • -
  • - If the [Yield] grammar parameter is not present on |ArrowParameters|, it is a Syntax Error if the lexical token sequence matched by |CoverParenthesizedExpressionAndArrowParameterList[?Yield]| cannot be parsed with no tokens left over using |ArrowFormalParameters[~Yield]| as the goal symbol. + It is a Syntax Error if the lexical token sequence matched by |CoverParenthesizedExpressionAndArrowParameterList| cannot be parsed with no tokens left over using |ArrowFormalParameters| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |CoverParenthesizedExpressionAndArrowParameterList|.
  • - All early errors rules for |ArrowFormalParameters| and its derived productions also apply to CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList[?Yield]|. + All early errors rules for |ArrowFormalParameters| and its derived productions also apply to CoveredFormalsList of |CoverParenthesizedExpressionAndArrowParameterList|.
@@ -18072,7 +18139,7 @@

Static Semantics: CoveredFormalsList

1. Return this |ArrowParameters|. - CoverParenthesizedExpressionAndArrowParameterList[Yield] : + CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : `(` Expression `)` `(` `)` `(` `...` BindingIdentifier `)` @@ -18081,8 +18148,7 @@

Static Semantics: CoveredFormalsList

`(` Expression `,` `...` BindingPattern `)`
- 1. If the [Yield] grammar parameter is present for |CoverParenthesizedExpressionAndArrowParameterList[Yield]|, return the result of parsing the lexical token stream matched by |CoverParenthesizedExpressionAndArrowParameterList[Yield]| using |ArrowFormalParameters[+Yield]| as the goal symbol. - 1. If the [Yield] grammar parameter is not present for |CoverParenthesizedExpressionAndArrowParameterList[Yield]|, return the result of parsing the lexical token stream matched by |CoverParenthesizedExpressionAndArrowParameterList[Yield]| using |ArrowFormalParameters[~Yield]| as the goal symbol. + 1. Return the result of parsing the lexical token stream matched by |CoverParenthesizedExpressionAndArrowParameterList| using |ArrowFormalParameters| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |CoverParenthesizedExpressionAndArrowParameterList|. @@ -18185,14 +18251,15 @@

Runtime Semantics: Evaluation

Method Definitions

Syntax

- MethodDefinition[Yield] : - PropertyName[?Yield] `(` UniqueFormalParameters[~Yield] `)` `{` FunctionBody[~Yield] `}` - GeneratorMethod[?Yield] - `get` PropertyName[?Yield] `(` `)` `{` FunctionBody[~Yield] `}` - `set` PropertyName[?Yield] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield] `}` + MethodDefinition[Yield, Await] : + PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, ~Await] `)` `{` FunctionBody[~Yield, ~Await] `}` + GeneratorMethod[?Yield, ?Await] + AsyncMethod[?Yield, ?Await] + `get` PropertyName[?Yield, ?Await] `(` `)` `{` FunctionBody[~Yield, ~Await] `}` + `set` PropertyName[?Yield, ?Await] `(` PropertySetParameterList `)` `{` FunctionBody[~Yield, ~Await] `}` PropertySetParameterList : - FormalParameter[~Yield] + FormalParameter[~Yield, ~Await] @@ -18366,23 +18433,23 @@

Runtime Semantics: PropertyDefinitionEvaluation

Generator Function Definitions

Syntax

- GeneratorMethod[Yield] : - `*` PropertyName[?Yield] `(` UniqueFormalParameters[+Yield] `)` `{` GeneratorBody `}` + GeneratorMethod[Yield, Await] : + `*` PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` - GeneratorDeclaration[Yield, Default] : - `function` `*` BindingIdentifier[?Yield] `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` - [+Default] `function` `*` `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + GeneratorDeclaration[Yield, Await, Default] : + `function` `*` BindingIdentifier[?Yield, ?Await] `(` FormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` + [+Default] `function` `*` `(` FormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` GeneratorExpression : - `function` `*` BindingIdentifier[+Yield]? `(` FormalParameters[+Yield] `)` `{` GeneratorBody `}` + `function` `*` BindingIdentifier[+Yield, ?Await]? `(` FormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` GeneratorBody : - FunctionBody[+Yield] + FunctionBody[+Yield, ~Await] - YieldExpression[In] : + YieldExpression[In, Await] : `yield` - `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield] - `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield] + `yield` [no LineTerminator here] AssignmentExpression[?In, +Yield, ?Await] + `yield` [no LineTerminator here] `*` AssignmentExpression[?In, +Yield, ?Await]

The syntactic context immediately following `yield` requires use of the |InputElementRegExpOrTemplateTail| lexical goal.

@@ -18707,29 +18774,29 @@

Runtime Semantics: Evaluation

Class Definitions

Syntax

- ClassDeclaration[Yield, Default] : - `class` BindingIdentifier[?Yield] ClassTail[?Yield] - [+Default] `class` ClassTail[?Yield] + ClassDeclaration[Yield, Await, Default] : + `class` BindingIdentifier[?Yield, ?Await] ClassTail[?Yield, ?Await] + [+Default] `class` ClassTail[?Yield, ?Await] - ClassExpression[Yield] : - `class` BindingIdentifier[?Yield]? ClassTail[?Yield] + ClassExpression[Yield, Await] : + `class` BindingIdentifier[?Yield, ?Await]? ClassTail[?Yield, ?Await] - ClassTail[Yield] : - ClassHeritage[?Yield]? `{` ClassBody[?Yield]? `}` + ClassTail[Yield, Await] : + ClassHeritage[?Yield, ?Await]? `{` ClassBody[?Yield, ?Await]? `}` - ClassHeritage[Yield] : - `extends` LeftHandSideExpression[?Yield] + ClassHeritage[Yield, Await] : + `extends` LeftHandSideExpression[?Yield, ?Await] - ClassBody[Yield] : - ClassElementList[?Yield] + ClassBody[Yield, Await] : + ClassElementList[?Yield, ?Await] - ClassElementList[Yield] : - ClassElement[?Yield] - ClassElementList[?Yield] ClassElement[?Yield] + ClassElementList[Yield, Await] : + ClassElement[?Yield, ?Await] + ClassElementList[?Yield, ?Await] ClassElement[?Yield, ?Await] - ClassElement[Yield] : - MethodDefinition[?Yield] - `static` MethodDefinition[?Yield] + ClassElement[Yield, Await] : + MethodDefinition[?Yield, ?Await] + `static` MethodDefinition[?Yield, ?Await] `;` @@ -18995,11 +19062,11 @@

Runtime Semantics: ClassDefinitionEvaluation

1. If |ClassHeritage_opt| is present and _protoParent_ is not *null*, then 1. Let _constructor_ be the result of parsing the source text
constructor(... args){ super (...args);}
- using the syntactic grammar with the goal symbol |MethodDefinition[~Yield]|. + using the syntactic grammar with the goal symbol |MethodDefinition[~Yield, ~Await]|. 1. Else, 1. Let _constructor_ be the result of parsing the source text
constructor( ){ }
- using the syntactic grammar with the goal symbol |MethodDefinition[~Yield]|. + using the syntactic grammar with the goal symbol |MethodDefinition[~Yield, ~Await]|. 1. Set the running execution context's LexicalEnvironment to _classScope_. 1. Let _constructorInfo_ be the result of performing DefineMethod for _constructor_ with arguments _proto_ and _constructorParent_ as the optional _functionPrototype_ argument. 1. Assert: _constructorInfo_ is not an abrupt completion. @@ -19078,6 +19145,537 @@

Runtime Semantics: Evaluation

+ +

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` `(` FormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + + AsyncMethod[Yield, Await] : + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` StrictFormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + + AsyncFunctionBody : + FunctionBody[~Yield, +Await] + + AwaitExpression[Yield] : + `await` UnaryExpression[?Yield, +Await] + + + +

`await` is parsed as an |AwaitExpression| when the [Await] parameter in present. The await parameter is present in the following contexts:

+
    +
  • In an |AsyncFunctionBody|.
  • +
  • In the |FormalParameters| of an |AsyncFunctionDeclaration| and |AsyncFunctionExpression|. |AwaitExpression| in this position is a syntax error via static semantics.
  • +
+

When |Module| is the syntatic goal symbol and the [Await] parameter is absent, `await` is parsed as a keyword and will be a syntax error. When |Script| is the syntactic goal symbol, `await` may be parsed as an identifier when the [Await] parameter is absent. This includes the following contexts:

+
    +
  • Anywhere outside of an |AsyncFunctionBody| or |FormalParameters| of an |AsyncFunctionDeclaration| or |AsyncFunctionExpression|.
  • +
  • In the |BindingIdentifier| of a |FunctionExpression| or |GeneratorExpression|.
  • +
+
+ + +

Unlike |YieldExpression|, it is a Syntax Error to omit the operand of an |AwaitExpression|. You must await something.

+
+ + +

Static Semantics: Early Errors

+ + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + +
    +
  • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |StrictFormalParameters| is *false*.
  • +
  • It is a Syntax Error if HasDirectSuper of |AsyncMethod| is *true*. +
  • It is a Syntax Error if |StrictFormalParameters| Contains |AwaitExpression| is *true*. +
  • It is a Syntax Error if any element of the BoundNames of |StrictFormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody| +
+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + +
    +
  • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
  • +
  • It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*. +
  • If the source code matching this production is strict code, the Early Error rules for |StrictFormalParameters| : |FormalParameters| are applied. +
  • If the source code matching this production is strict code, it is a Syntax Error if |BindingIdentifier| is the |IdentifierName| `eval` or the |IdentifierName| `arguments`. +
  • It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|. +
  • It is a Syntax Error if |FormalParameters| contains |SuperProperty| is *true*. +
  • It is a Syntax Error if |AsyncFunctionBody| contains |SuperProperty| is *true*. +
  • It is a Syntax Error if |FormalParameters| contains |SuperCall| is *true*. +
  • It is a Syntax Error if |AsyncFunctionBody| contains |SuperCall| is *true*. +
+
+ + +

Static Semantics: BoundNames

+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return the BoundNames of |BindingIdentifier|. + + + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return «`"*default*"`». + + "`*default*`" is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations. +
+ + +

Static Semantics: ComputedPropertyContains

+

With parameter _symbol_.

+ + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return the result of ComputedPropertyContains for |PropertyName| with argument _symbol_. + +
+ + +

Static Semantics: Contains

+

With parameter _symbol_.

+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *false*. + +
+ + +

Static Semantics: HasDirectSuper

+ + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. If |StrictFormalParameters| Contains |SuperCall| is *true*, return *true*. + 2. Return |AsyncFunctionBody| Contains |SuperCall|. + +
+ + +

Static Semantics: HasName

+ + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *false*. + + + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *true*. + +
+ + +

Static Semantics: IsConstantDeclaration

+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *false*. + +
+ + +

Static Semantics: IsFunctionDefinition

+ + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return *true*. + +
+ + +

Static Semantics: PropName

+ + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return PropName of |PropertyName|. + +
+ + +

Runtime Semantics: InstantiateFunctionObject

+

With parameter _scope_.

+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. + 2. Let _name_ be StringValue of |BindingIdentifier| + 3. Let _F_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 4. Perform SetFunctionName(_F_, _name_). + 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. + 5. Return _F_. + + + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. + 2. Let _F_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 3. Perform SetFunctionName(_F_, `"default"`). + 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. + 4. Return _F_. + +
+ + +

Runtime Semantics: EvaluateBody

+

With parameters _functionObject_ and List _argumentsList_.

+ + AsyncFunctionBody : FunctionBody + + + 1. Let _promiseCapability_ be NewPromiseCapability(%Promise%). + 1. Let _declResult_ be FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). + 1. If _declResult_ is not an abrupt completion, then + 1. Perform ! AsyncFunctionStart(_promiseCapability_, _FunctionBody_). + 1. Else _declResult_ is an abrupt completion + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). + 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}. + +
+ + +

Runtime Semantics: PropertyDefinitionEvaluation

+

With parameters _object_ and _enumerable_.

+ + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Let _propKey_ be the result of evaluating |PropertyName|. + 1. ReturnIfAbrupt(_propKey_). + 1. If the function code for this |AsyncMethod| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. + 1. Let _scope_ be the LexicalEnvironment of the running execution context. + 1. Let _closure_ be AsyncFunctionCreate(~Method~, |StrictFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 1. Perform ! MakeMethod(_closure_, _object_). + 1. Perform ! SetFunctionName(_closure_, _propKey_). + 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncMethod|. + 1. Let _desc_ be the Property Descriptor{[[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true*}. + 1. Return ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). + +
+ +

Runtime Semantics: Evaluation

+ + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return NormalCompletion(~empty~). + + + + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. Return NormalCompletion(~empty~). + + + + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. If the function code for |AsyncFunctionExpression| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. + 1. Let _scope_ be the LexicalEnvironment of the running execution context. + 1. Let _closure_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. + 1. Return _closure_. + + + + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + + + 1. If the function code for |AsyncFunctionExpression| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. + 1. Let _scope_ be the LexicalEnvironment of the running execution context. + 1. Let _funcEnv_ be NewDeclarativeEnvironment(_scope_). + 1. Let _envRec_ be _funcEnv_'s EnvironmentRecord. + 1. Let _name_ be StringValue of |BindingIdentifier|. + 1. Perform _envRec_.CreateImmutableBinding( _name_). + 1. Let _closure_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _funcEnv_, _strict_). + 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. + 1. Perform SetFunctionName(_closure_, _name_). + 1. Perform _envRec_.InitializeBinding( _name_, _closure_). + 1. Return _closure_. + + + + AwaitExpression :: `await` UnaryExpression + + + 1. Let _exprRef_ be the result of evaluating |UnaryExpression|. + 1. Let _value_ be ? GetValue(_exprRef_). + 1. Return AsyncFunctionAwait(_value_). + +
+
+ + +

Async Arrow Function Definitions

+

Syntax

+ + AsyncArrowFunction[In, Yield, Await] : + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + + AsyncConciseBody[In, ?Yield] : + [lookahead != `{`] AssignmentExpression[?In, ?Yield, +Await] + `{` AsyncFunctionBody `}` + + AsyncArrowBindingIdentifier[Yield] : + BindingIdentifier[?Yield, +Await] + + CoverCallExpressionAndAsyncArrowHead[Yield, Await] : + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + +

Supplemental Syntax

+

When processing the production AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

+ + + AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[Await] + + + +

Static Semantics: Early Errors

+ + AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody + +
    +
  • It is a Syntax Error if ContainsUseStrict of |AsyncConciseBody| is *true* and IsSimpleParameterList of |ArrowParameters| is *false*.
  • +
  • It is a Syntax Error if any element of the BoundNames of |AsyncArrowBindingIdentifier| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|. +
+ + AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody + +
    +
  • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |YieldExpression| is *true*. +
  • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |AwaitExpression| is *true*. +
  • It is a Syntax Error if any element of the BoundNames of |CoverCallExpressionAndAsyncArrowHead| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|. +
  • It is a Syntax Error if the lexical token sequence matched by |CoverCallExpressionAndAsyncArrowHead| cannot be parsed with no tokens left over using |AsyncArrowHead| as the goal symbol.
  • +
  • All Early Error rules for |AsyncArrowHead| and its derived productions apply to CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
  • +
+
+ + +

Static Semantics: CoveredAsyncArrowHead

+

+ + CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments + + + 1. Return the result of parsing the lexical token stream matched by |CoverCallExpressionAndAsyncArrowHead|[Yield, Await] using |AsyncArrowHead| as the goal symbol. + +
+ + +

Static Semantics: BoundNames

+ + CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments + + + 1. Let _head_ be CoveredAsyncFunctionHead of |CoverCallExpressionAndAsyncArrowHead|. + 1. Return the BoundNames of _head_. + +
+ + +

Static Semantics: Contains

+

With parameter _symbol_.

+ + AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody + + + 1. If _symbol_ is not one of NewTarget, SuperProperty, SuperCall, super, or this, return *false*. + 1. Return |AsyncConciseBody| contains _symbol_. + + + AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody + + + 1. If _symbol_ is not one of NewTarget, SuperProperty, SuperCall, super, or this, return *false*. + 2. Let _head_ be CoveredAsyncFunctionHead of |CoverCallExpressionAndAsyncArrowHead|. + 3. If _head_ Contains _symbol_ is *true*, return *true*. + 4. Return |AsyncConciseBody| Contains _symbol_. + + Normally, Contains does not look inside most function forms. However, Contains is used to detect `new.target`, `this`, and `super` usage within an AsyncArrowFunction. +
+ + +

Static Semantics: ContainsExpression

+ + AsyncArrowBindingIdentifier : BindingIdentifier + + + 1. Return *false*. + +
+ + +

Static Semantics: ExpectedArgumentCount

+ + AsyncArrowBindingIdentifier : BindingIdentifier + + + 1. Return *1*. + +
+ + +

Static Semantics: HasName

+ + AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody + AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody + + + 1. Return *false*. + +
+ + +

Static Semantics: IsSimpleParameterList

+ + AsyncArrowBindingIdentifier[Yield] : BindingIdentifier[?Yield, +Await] + + + 1. Return *true*. + +
+ + +

Static Semantics: LexicallyDeclaredNames

+ + AsyncConciseBody : [lookahead != `{`] AssignmentExpression + + + 1. Return an empty List. + +
+ + +

Static Semantics: LexicallyScopedDeclarations

+ + AsyncConciseBody : [lookahead != `{`] AssignmentExpression + + + 1. Return an empty List. + +
+ + +

Static Semantics: VarDeclaredNames

+ + AsyncConciseBody : [lookahead != `{`] AssignmentExpression + + + 1. Return an empty List. + +
+ + +

Static Semantics: VarScopedDeclarations

+ + AsyncConciseBody : [lookahead != `{`] AssignmentExpression + + + 1. Return an empty List. + +
+ + +

Runtime Semantics: IteratorBindingInitialization

+

With parameters _iteratorRecord_ and _environment_.

+ + AsyncArrowBindingIdentifier : BindingIdentifier[?Yield, +Await] + + + 1. Assert: _iteratorRecord_.[[done]] is *false*. + 1. Let _next_ be IteratorStep(_iteratorRecord_.[[iterator]]). + 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. + 1. ReturnIfAbrupt(_next_). + 1. If _next_ is *false*, set _iteratorRecord_.[[done]] to true. + 1. Else + 1. Let _v_ be IteratorValue(_next_). + 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. + 1. ReturnIfAbrupt(_v_). + 1. If _iteratorRecord_.[[done]] is *true*, let _v_ be *undefined*. + 1. Return the result of performing BindingInitialization for |BindingIdentifier| using _v_ and _environment_ as the arguments. + +
+ + +

Runtime Semantics: EvaluateBody

+

With parameter _functionObject_ and List _argumentsList_.

+ + AsyncConciseBody : [lookahead != `{`] AssignmentExpression + + + 1. Let _promiseCapability_ be NewPromiseCapability(%Promise%). + 1. Let _declResult_ be FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). + 1. If _declResult_ is not an abrupt completion, then + 1. Perform ! AsyncFunctionStart(_promiseCapability_, _AssignmentExpression_). + 1. Else _declResult_ is an abrupt completion + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). + 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}. + + + AsyncConciseBody : {` AsyncFunctionBody `}` + + + 1. Return the result of calling EvaluateBody of |AsyncFunctionBody| passing _functionObject_ and _argumentsList_ as the arguments. + +
+ + +

Runtime Semantics: Evaluation

+ + AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody + + + 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be true. Otherwise, let _strict_ be false. + 2. Let _scope_ be the LexicalEnvironment of the running execution context. + 3. Let _parameters_ be |AsyncArrowBindingIdentifier|. + 4. Let _closure_ be AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). + 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. + 5. Return _closure_. + + + AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody + + + 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be true. Otherwise, let _strict_ be false. + 2. Let _scope_ be the LexicalEnvironment of the running execution context. + 3. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|. + 4. Let _parameters_ be the |ArrowFormalParameters| production matched by _head_. + 5. Let _closure_ be AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). + 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. + 6. Return _closure_. + +
+
+

Tail Position Calls

@@ -19242,6 +19840,7 @@

Expression Rules

AssignmentExpression : YieldExpression ArrowFunction + AsyncArrowFunction LeftHandSideExpression `=` AssignmentExpression LeftHandSideExpression AssignmentOperator AssignmentExpression @@ -19318,6 +19917,7 @@

Expression Rules

FunctionExpression ClassExpression GeneratorExpression + AsyncFunctionExpression RegularExpressionLiteral TemplateLiteral @@ -19410,7 +20010,7 @@

Syntax

ScriptBody? ScriptBody : - StatementList[~Yield, ~Return] + StatementList[~Yield, ~Await, ~Return] @@ -19723,7 +20323,7 @@

Syntax

ModuleItem : ImportDeclaration ExportDeclaration - StatementListItem[~Yield, ~Return] + StatementListItem[~Yield, ~Await, ~Return] @@ -20995,7 +21595,7 @@

Syntax

StringLiteral ImportedBinding : - BindingIdentifier[~Yield] + BindingIdentifier[~Yield, ~Await] @@ -21141,11 +21741,11 @@

Syntax

`export` `*` FromClause `;` `export` ExportClause FromClause `;` `export` ExportClause `;` - `export` VariableStatement[~Yield] - `export` Declaration[~Yield] - `export` `default` HoistableDeclaration[~Yield, +Default] - `export` `default` ClassDeclaration[~Yield, +Default] - `export` `default` [lookahead <! {`function`, `class`}] AssignmentExpression[+In, ~Yield] `;` + `export` VariableStatement[~Yield, ~Await] + `export` Declaration[~Yield, ~Await] + `export` `default` HoistableDeclaration[~Yield, ~Await, +Default] + `export` `default` ClassDeclaration[~Yield, ~Await, +Default] + `export` `default` [lookahead <! {`function`, `async` [no |LineTerminator| here] `function`, `class`}] AssignmentExpression[+In, ~Yield, ~Await] `;` ExportClause : `{` `}` @@ -21605,7 +22205,7 @@

Forbidden Extensions

An implementation must not extend this specification in the following ways:

  • - Other than as defined in this specification, ECMAScript Function objects defined using syntactic constructors in strict mode code must not be created with own properties named `"caller"` or `"arguments"` other than those that are created by applying the AddRestrictedFunctionProperties abstract operation to the function. Such own properties also must not be created for function objects defined using an |ArrowFunction|, |MethodDefinition|, |GeneratorDeclaration|, |GeneratorExpression|, |ClassDeclaration|, or |ClassExpression| regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the `Function` constructor, generator functions created using the `Generator` constructor, and functions created using the `bind` method also must not be created with such own properties. + Other than as defined in this specification, ECMAScript Function objects defined using syntactic constructors in strict mode code must not be created with own properties named `"caller"` or `"arguments"` other than those that are created by applying the AddRestrictedFunctionProperties abstract operation to the function. Such own properties also must not be created for function objects defined using an |ArrowFunction|, |MethodDefinition|, |GeneratorDeclaration|, |GeneratorExpression|, |ClassDeclaration|, |ClassExpression|, |AsyncFunctionDeclaration|, |AsyncFunctionExpression|, or |AsyncArrowFunction| regardless of whether the definition is contained in strict mode code. Built-in functions, strict functions created using the `Function` constructor, generator functions created using the `Generator` constructor, and functions created using the `bind` method also must not be created with such own properties.
  • If an implementation extends non-strict or built-in function objects with an own property named `"caller"` the value of that property, as observed using [[Get]] or [[GetOwnProperty]], must not be a strict function object. If it is an accessor property, the function that is the value of the property's [[Get]] attribute must never return a strict function when called. @@ -23047,17 +23647,22 @@

    Function ( _p1_, _p2_, … , _pn_, _body_ )

    Runtime Semantics: CreateDynamicFunction(_constructor_, _newTarget_, _kind_, _args_)

    -

    The abstract operation CreateDynamicFunction is called with arguments _constructor_, _newTarget_, _kind_, and _args_. _constructor_ is the constructor function that is performing this action, _newTarget_ is the constructor that `new` was initially applied to, _kind_ is either `"normal"` or `"generator"`, and _args_ is a List containing the actual argument values that were passed to _constructor_. The following steps are taken:

    +

    The abstract operation CreateDynamicFunction is called with arguments _constructor_, _newTarget_, _kind_, and _args_. _constructor_ is the constructor function that is performing this action, _newTarget_ is the constructor that `new` was initially applied to, _kind_ is either `"normal"`, `"generator"`, or `"async"`, and _args_ is a List containing the actual argument values that were passed to _constructor_. The following steps are taken:

    1. If _newTarget_ is *undefined*, let _newTarget_ be _constructor_. 1. If _kind_ is `"normal"`, then - 1. Let _goal_ be the grammar symbol |FunctionBody[~Yield]|. - 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[~Yield]|. + 1. Let _goal_ be the grammar symbol |FunctionBody[~Yield, ~Await]|. + 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[~Yield, ~Await]|. 1. Let _fallbackProto_ be `"%FunctionPrototype%"`. - 1. Else, + 1. Else if _kind_ is `"generator"`, 1. Let _goal_ be the grammar symbol |GeneratorBody|. - 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[+Yield]|. + 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[+Yield, ~Await]|. 1. Let _fallbackProto_ be `"%Generator%"`. + 1. Else, + 1. Assert: _kind_ is `"async"` + 1. Let _goal_ be the grammar symbol |AsyncFunctionBody|. + 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[~Yield, +Await]|. + 1. Let _fallbackProto_ be `"%AsyncFunctionPrototype%"`. 1. Let _argCount_ be the number of elements in _args_. 1. Let _P_ be the empty String. 1. If _argCount_ = 0, let _bodyText_ be the empty String. @@ -23085,6 +23690,8 @@

    Runtime Semantics: CreateDynamicFunction(_constructor_, _newTarget_, _kind_, 1. If _parameters_ Contains |SuperProperty| is *true*, throw a *SyntaxError* exception. 1. If _kind_ is `"generator"`, then 1. If _parameters_ Contains |YieldExpression| is *true*, throw a *SyntaxError* exception. + 1. If _kind_ is `"async"`, then + 1. If _parameters_ Contains |AwaitExpression| is *true*, throw a *SyntaxError* exception. 1. If _strict_ is *true*, then 1. If BoundNames of _parameters_ contains any duplicate elements, throw a *SyntaxError* exception. 1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _fallbackProto_). @@ -23096,6 +23703,7 @@

    Runtime Semantics: CreateDynamicFunction(_constructor_, _newTarget_, _kind_, 1. Let _prototype_ be ObjectCreate(%GeneratorPrototype%). 1. Perform DefinePropertyOrThrow(_F_, `"prototype"`, PropertyDescriptor{[[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false*}). 1. Else, perform MakeConstructor(_F_). + 1. Note: Async functions are not constructable and do not have a prototype property. 1. Perform SetFunctionName(_F_, `"anonymous"`). 1. Return _F_. @@ -34945,6 +35553,191 @@

    Properties of Promise Instances

    + + +

    Async Function Objects

    + +

    The Async Function Constructor

    + +

    The `AsyncFunction` Constructor is the %AsyncFunction% intrinsic object and is a subclass of `Function`. When `AsyncFunction` is called as a function rather than as a constructor, it creates and initializes a new AsyncFunction object. Thus the function call `AsyncFunction(…)` is equivalent to the object creation expression `new AsyncFunction(…)` with the same arguments.

    + +

    The `AsyncFunction` constructor is designed to be subclassable. It may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified AsyncFunction behaviour must include a super call to the AsyncFunction constructor to create and initialize a subclass instances with the internal slots necessary for built-in async function behaviour.

    + + +

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    + +

    The last argument specifies the body (executable code) of an async function. Any preceding arguments specify formal parameters. + +

    When the `AsyncFunction` function is called with some arguments _p1_, _p2_, ..., _pn_, _body_ (where _n_ might be 0, that is, there are no _p_ arguments, and where _body_ might also not be provided), the following steps are taken:

    + + + 1. Let _C_ be the active function object. + 2. Let _args_ be the argumentsList that was passed to this function by [[Call]] or [[Construct]]. + 3. Return CreateDynamicFunction(_C_, NewTarget, "async", _args_). + + + See note for 19.2.1.1 +
    +
    + +

    Properties of the AsyncFunction constructor

    + +

    The AsyncFunction constructor is a standard built-in function object that inherits from the `Function` constructor. The value of the [[Prototype]] internal slot of the AsyncFunction constructor is the intrinsic object %Function%. + +

    The value of the [[Extensible]] internal slot of the AsyncFunction constructor is *true*. + +

    The value of the *name* property of the AsyncFunction is "AsyncFunction". + +

    The AsyncFunction constructor has the following properties:

    + + +

    AsyncFunction.length

    +

    This is a data property with a value of 1. This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

    +
    + + +

    AsyncFunction.prototype

    +

    The initial value of `AsyncFunction.prototype` is the intrinsic object %AsyncFunctionPrototype%.

    + +

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

    +
    +
    + +

    Properties of the AsyncFunction Prototype Object

    +

    The AsyncFunction prototype object is an ordinary object. In addition to being the value of the prototype property of the %AsyncFunction% intrinsic, it is the %AsyncFunctionPrototype% intrinsic.

    + +

    The value of the [[Prototype]] internal slot of the AsyncFunction prototype object is the %FunctionPrototype% intrinsic object. The initial value of the [[Extensible]] internal slot of the AsyncFunction prototype object is *true*.

    + +

    The AsyncFunction prototype object does not have a prototype property.

    + Presumably this could be Promise.prototype but I'm not sure this has any value? + + + +

    AsyncFunction.prototype.constructor

    + +

    The initial value of `AsyncFunction.prototype.constructor` is the intrinsic object %AsyncFunction%

    + +

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

    +
    + + +

    AsyncFunction.prototype[@@toStringTag]

    + +

    The initial value of the @@toStringTag property is the string value "AsyncFunction".

    + +

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

    +
    +
    + + +

    AsyncFunction Instances

    + +

    Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in Table 27. The value of the [[FunctionKind]] internal slot for all such instances is `"normal"`. AsyncFunction instances are not constructors and do not have a [[Construct]] internal slot. AsyncFunction instances do not have a prototype property as they are not constructable.

    + +

    Each AsyncFunction instance has the following own properties:

    + +

    length

    +

    The value of the *length* property is an integer that indicates the typical number of arguments expected by the AsyncFunction. However, the language permits the function to be invoked with some other number of arguments. The behaviour of an AsyncFunction when invoked on a number of arguments other than the number specified by its length property depends on the function.

    + +

    This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

    +
    + + +

    name

    + +

    The specification for the `name` property of Function instances given in 19.2.4.2 also applies to AsyncFunction instances.

    +
    +
    + + +

    Async Functions Abstract Operations

    + + +

    AsyncFunctionCreate ( _kind_, |ParameterList|, |Body|, _Scope_, _Strict_ )

    +

    The abstract operation AsyncFunctionCreate requires the arguments: _kind_ which is one of (~Normal~, ~Method~, ~Arrow~), a parameter list production specified by |ParameterList|, a body production specified by |Body|, a Lexical Environment specified by _Scope_, and a Boolean flag _Strict_. AsyncFunctionCreate performs the following steps:

    + + 1. Let _functionPrototype_ be the intrinsic object %AsyncFunctionPrototype%. + 2. Let _F_ be ! FunctionAllocate(_functionPrototype_, _Strict_, `"non-constructor"`). + 3. Return ! FunctionInitialize(_F_, _kind_, |ParameterList|, |Body|, _Scope_). + +
    + + +

    AsyncFunctionStart ( _promiseCapability_, |asyncFunctionBody| )

    + + 1. Let _runningContext_ be the running execution context. + 1. Let _asyncContext_ be a copy of _runningContext_. + 1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context the following steps will be performed: + 1. Let _result_ be the result of evaluating _asyncFunctionBody_. + 1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done. + 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. + 1. If _result_.[[type]] is ~normal~, then + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «*undefined*»). + 1. Else if _result_.[[type]] is ~return~, then + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «_result_.[[value]]»). + 1. Else, + 1. Assert: _result_.[[type]] is ~throw~. + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_result_.[[value]]»). + 1. Return. + 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. + 1. Resume the suspended evaluation of _asyncContext_. Let _result_ be the value returned by the resumed computation. + 1. Assert: When we return here, _asyncContext_ has already been removed from the execution context stack and _runningContext_ is the currently running execution context. + 1. Assert: _result_ is a normal completion with a value of *undefined*. The possible sources of completion values are AsyncFunctionAwait or, if the async function doesn't await anything, the step 3.7 above. + 1. Return. + +
    + + +

    AsyncFunctionAwait ( _value_ )

    + + 1. Let _asyncContext_ be the running execution context. + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). + 1. Let _onFulfilled_ be a new built-in function object as defined in AsyncFunction Awaited Fulfilled. + 1. Let _onRejected_ be a new built-in function object as defined in AsyncFunction Awaited Rejected. + 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. + 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). + 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). + 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. + 1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed with a Completion _resumptionValue_ the following steps will be performed: + 1. Return _resumptionValue_. + 1. Return. + + + + + The return value of this abstract operation is unused. The interesting return is that of _resumptionValue_ being returned to the |AwaitExpression| production that originally called this abstract operation. +
    + + +

    AsyncFunction Awaited Fulfilled

    +

    Function _F_ is called with the parameter _value_.

    + + 1. Let _asyncContext_ be the value of _F_'s [[AsyncContext]] internal slot. + 1. Let _prevContext_ be the running execution context. + 1. Suspend _prevContext_. + 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. + 1. Resume the suspended evaluation of _asyncContext_ using NormalCompletion(_value_) as the result of the operation that suspended it. Let _result_ be the value returned by the resumed computation. + 1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context. + 1. Return Completion(_result_). + +
    + + +

    AsyncFunction Awaited Rejected

    +

    Function _F_ is called with the parameter _reason_.

    + + 1. Let _asyncContext_ be the value of _F_'s [[AsyncContext]] internal slot. + 1. Let _prevContext_ be the running execution context. + 1. Suspend _prevContext_. + 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. + 1. Resume the suspended evaluation of _asyncContext_ using Completion{[[type]]: ~throw~, [[value]]: _reason_, [[target]]: ~empty~} as the result of the operation that suspended it. Let _result_ be the value returned by the resumed computation. + 1. Assert: When we reach this step, _asyncContext_ has already been removed from the execution context stack and _prevContext_ is the currently running execution context. + 1. Return Completion(_result_). + +
    +
    +
    @@ -35301,6 +36094,7 @@

    Expressions

    + @@ -35329,6 +36123,11 @@

    Expressions

    + +

    When processing the production the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

    + +

     

    + @@ -35436,6 +36235,11 @@

    Functions and Classes

    When the production is recognized the following grammar is used to refine the interpretation of |CoverParenthesizedExpressionAndArrowParameterList|:

     

    + + +

    When the production is recognized the following grammar is used to refine the interpretation of |CoverParenthesizedExpressionAndArrowParameterList|:

    + +

     

    @@ -35443,6 +36247,11 @@

    Functions and Classes

    + + + + + @@ -36615,11 +37424,11 @@

    Changes to BlockDeclarationInstantiation

    FunctionDeclarations in IfStatement Statement Clauses

    The following augments the |IfStatement| production in :

    - IfStatement[Yield, Return] : - `if` `(` Expression[+In, ?Yield] `)` FunctionDeclaration[?Yield, ~Default] `else` Statement[?Yield, ?Return] - `if` `(` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] `else` FunctionDeclaration[?Yield, ~Default] - `if` `(` Expression[+In, ?Yield] `)` FunctionDeclaration[?Yield, ~Default] `else` FunctionDeclaration[?Yield, ~Default] - `if` `(` Expression[+In, ?Yield] `)` FunctionDeclaration[?Yield, ~Default] + IfStatement[Yield, Await, Return] : + `if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` Statement[?Yield, ?Await, ?Return] + `if` `(` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return] `else` FunctionDeclaration[?Yield, ?Await, ~Default] + `if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` FunctionDeclaration[?Yield, ?Await, ~Default] + `if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default]

    This production only applies when parsing non-strict code. Code matching this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in .

    @@ -36660,8 +37469,8 @@

    VariableStatements in Catch Blocks

    Initializers in ForIn Statement Heads

    The following augments the |IterationStatement| production in :

    - IterationStatement[Yield, Return] : - `for` `(` `var` BindingIdentifier[?Yield] Initializer[~In, ?Yield] `in` Expression[+In, ?Yield] `)` Statement[?Yield, ?Return] + IterationStatement[Yield, Await, Return] : + `for` `(` `var` BindingIdentifier[?Yield, ?Await] Initializer[~In, ?Yield, ?Await] `in` Expression[+In, ?Yield, ?Await] `)` Statement[?Yield, ?Await, ?Return]

    This production only applies when parsing non-strict code.

    The static semantics of ContainsDuplicateLabels in are augmented with the following:

    From da54c6a0624b14411813451182d6c43614664fda Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Thu, 15 Sep 2016 14:55:39 -0700 Subject: [PATCH 02/42] Add changes to EvaluateBody --- spec.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index c122914a01..9be38fb071 100644 --- a/spec.html +++ b/spec.html @@ -6881,7 +6881,6 @@

    OrdinaryCallBindThis ( _F_, _calleeContext_, _thisArgument_ )

    OrdinaryCallEvaluateBody ( _F_, _argumentsList_ )

    When the abstract operation OrdinaryCallEvaluateBody is called with function object _F_ and List _argumentsList_, the following steps are taken:

    - 1. Perform ? FunctionDeclarationInstantiation(_F_, _argumentsList_). 1. Return the result of EvaluateBody of the parsed code that is _F_.[[ECMAScriptCode]] passing _F_ as the argument. @@ -17844,10 +17843,11 @@

    Static Semantics: VarScopedDeclarations

    Runtime Semantics: EvaluateBody

    -

    With parameter _functionObject_.

    +

    With parameter _functionObject_ and List _argumentsList_.

    FunctionBody : FunctionStatementList + 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Return the result of evaluating |FunctionStatementList|.
    @@ -18219,10 +18219,11 @@

    Runtime Semantics: IteratorBindingInitialization

    Runtime Semantics: EvaluateBody

    -

    With parameter _functionObject_.

    +

    With parameter _functionObject_ and List _argumentsList_.

    ConciseBody : AssignmentExpression + 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _exprRef_ be the result of evaluating |AssignmentExpression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). 1. Return Completion{[[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~}. @@ -18627,10 +18628,11 @@

    Static Semantics: PropName

    Runtime Semantics: EvaluateBody

    -

    With parameter _functionObject_.

    +

    With parameter _functionObject_ and List _argumentsList_.

    GeneratorBody : FunctionBody + 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _G_ be ? OrdinaryCreateFromConstructor(_functionObject_, `"%GeneratorPrototype%"`, « [[GeneratorState]], [[GeneratorContext]] »). 1. Perform GeneratorStart(_G_, |FunctionBody|). 1. Return Completion{[[Type]]: ~return~, [[Value]]: _G_, [[Target]]: ~empty~}. From 1ebb66f3781146a51db9ea16af3ccfc04140b6de Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Thu, 15 Sep 2016 15:14:24 -0700 Subject: [PATCH 03/42] Add some missing RIA assertions --- spec.html | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/spec.html b/spec.html index 9be38fb071..c923736d7e 100644 --- a/spec.html +++ b/spec.html @@ -19326,8 +19326,8 @@

    Runtime Semantics: InstantiateFunctionObject

    1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. 2. Let _name_ be StringValue of |BindingIdentifier| - 3. Let _F_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). - 4. Perform SetFunctionName(_F_, _name_). + 3. Let _F_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 4. Perform ! SetFunctionName(_F_, _name_). 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. 5. Return _F_. @@ -19336,8 +19336,8 @@

    Runtime Semantics: InstantiateFunctionObject

    1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. - 2. Let _F_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). - 3. Perform SetFunctionName(_F_, `"default"`). + 2. Let _F_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 3. Perform ! SetFunctionName(_F_, `"default"`). 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. 4. Return _F_. @@ -19350,7 +19350,7 @@

    Runtime Semantics: EvaluateBody

    AsyncFunctionBody : FunctionBody - 1. Let _promiseCapability_ be NewPromiseCapability(%Promise%). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _declResult_ be FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _FunctionBody_). @@ -19371,7 +19371,7 @@

    Runtime Semantics: PropertyDefinitionEvaluation

    1. ReturnIfAbrupt(_propKey_). 1. If the function code for this |AsyncMethod| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. 1. Let _scope_ be the LexicalEnvironment of the running execution context. - 1. Let _closure_ be AsyncFunctionCreate(~Method~, |StrictFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 1. Let _closure_ be ! AsyncFunctionCreate(~Method~, |StrictFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 1. Perform ! MakeMethod(_closure_, _object_). 1. Perform ! SetFunctionName(_closure_, _propKey_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncMethod|. @@ -19401,7 +19401,7 @@

    Runtime Semantics: Evaluation

    1. If the function code for |AsyncFunctionExpression| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. 1. Let _scope_ be the LexicalEnvironment of the running execution context. - 1. Let _closure_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 1. Let _closure_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. 1. Return _closure_. @@ -19412,14 +19412,14 @@

    Runtime Semantics: Evaluation

    1. If the function code for |AsyncFunctionExpression| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. 1. Let _scope_ be the LexicalEnvironment of the running execution context. - 1. Let _funcEnv_ be NewDeclarativeEnvironment(_scope_). + 1. Let _funcEnv_ be ! NewDeclarativeEnvironment(_scope_). 1. Let _envRec_ be _funcEnv_'s EnvironmentRecord. 1. Let _name_ be StringValue of |BindingIdentifier|. - 1. Perform _envRec_.CreateImmutableBinding( _name_). - 1. Let _closure_ be AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _funcEnv_, _strict_). + 1. Perform ! _envRec_.CreateImmutableBinding( _name_). + 1. Let _closure_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _funcEnv_, _strict_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. - 1. Perform SetFunctionName(_closure_, _name_). - 1. Perform _envRec_.InitializeBinding( _name_, _closure_). + 1. Perform ! SetFunctionName(_closure_, _name_). + 1. Perform ! _envRec_.InitializeBinding( _name_, _closure_). 1. Return _closure_. @@ -19429,7 +19429,7 @@

    Runtime Semantics: Evaluation

    1. Let _exprRef_ be the result of evaluating |UnaryExpression|. 1. Let _value_ be ? GetValue(_exprRef_). - 1. Return AsyncFunctionAwait(_value_). + 1. Return ? AsyncFunctionAwait(_value_).
    @@ -19614,12 +19614,12 @@

    Runtime Semantics: IteratorBindingInitialization

    1. Assert: _iteratorRecord_.[[done]] is *false*. - 1. Let _next_ be IteratorStep(_iteratorRecord_.[[iterator]]). + 1. Let _next_ be ? IteratorStep(_iteratorRecord_.[[iterator]]). 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. 1. ReturnIfAbrupt(_next_). 1. If _next_ is *false*, set _iteratorRecord_.[[done]] to true. 1. Else - 1. Let _v_ be IteratorValue(_next_). + 1. Let _v_ be ? IteratorValue(_next_). 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. 1. ReturnIfAbrupt(_v_). 1. If _iteratorRecord_.[[done]] is *true*, let _v_ be *undefined*. @@ -19634,8 +19634,8 @@

    Runtime Semantics: EvaluateBody

    AsyncConciseBody : [lookahead != `{`] AssignmentExpression - 1. Let _promiseCapability_ be NewPromiseCapability(%Promise%). - 1. Let _declResult_ be FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _declResult_ be ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _AssignmentExpression_). 1. Else _declResult_ is an abrupt completion @@ -19659,7 +19659,7 @@

    Runtime Semantics: Evaluation

    1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be true. Otherwise, let _strict_ be false. 2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _parameters_ be |AsyncArrowBindingIdentifier|. - 4. Let _closure_ be AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). + 4. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. 5. Return _closure_.
    @@ -19671,7 +19671,7 @@

    Runtime Semantics: Evaluation

    2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|. 4. Let _parameters_ be the |ArrowFormalParameters| production matched by _head_. - 5. Let _closure_ be AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). + 5. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. 6. Return _closure_.
    @@ -35698,7 +35698,7 @@

    AsyncFunctionAwait ( _value_ )

    1. Let _onFulfilled_ be a new built-in function object as defined in AsyncFunction Awaited Fulfilled. 1. Let _onRejected_ be a new built-in function object as defined in AsyncFunction Awaited Rejected. 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. - 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). + 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed with a Completion _resumptionValue_ the following steps will be performed: @@ -35706,8 +35706,6 @@

    AsyncFunctionAwait ( _value_ )

    1. Return. - - The return value of this abstract operation is unused. The interesting return is that of _resumptionValue_ being returned to the |AwaitExpression| production that originally called this abstract operation. From b0949d526b2423b44fc3a145ecf8f13a52eda054 Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Fri, 16 Sep 2016 12:26:24 -0700 Subject: [PATCH 04/42] Replace link with xref --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index c923736d7e..99f8a3c333 100644 --- a/spec.html +++ b/spec.html @@ -35695,8 +35695,8 @@

    AsyncFunctionAwait ( _value_ )

    1. Let _asyncContext_ be the running execution context. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). - 1. Let _onFulfilled_ be a new built-in function object as defined in AsyncFunction Awaited Fulfilled. - 1. Let _onRejected_ be a new built-in function object as defined in AsyncFunction Awaited Rejected. + 1. Let _onFulfilled_ be a new built-in function object as defined in . + 1. Let _onRejected_ be a new built-in function object as defined in . 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). From f1e9aabbc63792fafbcc619b7d9c63e3d9353254 Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Fri, 16 Sep 2016 12:29:42 -0700 Subject: [PATCH 05/42] Fix up abstract op clause IDs. --- spec.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec.html b/spec.html index 99f8a3c333..0997f8ff1f 100644 --- a/spec.html +++ b/spec.html @@ -35654,7 +35654,7 @@

    name

    Async Functions Abstract Operations

    - +

    AsyncFunctionCreate ( _kind_, |ParameterList|, |Body|, _Scope_, _Strict_ )

    The abstract operation AsyncFunctionCreate requires the arguments: _kind_ which is one of (~Normal~, ~Method~, ~Arrow~), a parameter list production specified by |ParameterList|, a body production specified by |Body|, a Lexical Environment specified by _Scope_, and a Boolean flag _Strict_. AsyncFunctionCreate performs the following steps:

    @@ -35664,7 +35664,7 @@

    AsyncFunctionCreate ( _kind_, |ParameterList|, |Body|, _Scope_, _Strict_ ) - +

    AsyncFunctionStart ( _promiseCapability_, |asyncFunctionBody| )

    1. Let _runningContext_ be the running execution context. @@ -35689,14 +35689,14 @@

    AsyncFunctionStart ( _promiseCapability_, |asyncFunctionBody| )

    - +

    AsyncFunctionAwait ( _value_ )

    1. Let _asyncContext_ be the running execution context. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). - 1. Let _onFulfilled_ be a new built-in function object as defined in . - 1. Let _onRejected_ be a new built-in function object as defined in . + 1. Let _onFulfilled_ be a new built-in function object as defined in . + 1. Let _onRejected_ be a new built-in function object as defined in . 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). @@ -35709,7 +35709,7 @@

    AsyncFunctionAwait ( _value_ )

    The return value of this abstract operation is unused. The interesting return is that of _resumptionValue_ being returned to the |AwaitExpression| production that originally called this abstract operation.
    - +

    AsyncFunction Awaited Fulfilled

    Function _F_ is called with the parameter _value_.

    @@ -35723,7 +35723,7 @@

    AsyncFunction Awaited Fulfilled

    - +

    AsyncFunction Awaited Rejected

    Function _F_ is called with the parameter _reason_.

    From a652b09c81a75a596cf3000b2aac04cfb3b54853 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:07:50 -0400 Subject: [PATCH 06/42] Fix indentation. --- spec.html | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/spec.html b/spec.html index 0997f8ff1f..9081bbfb21 100644 --- a/spec.html +++ b/spec.html @@ -19152,21 +19152,21 @@

    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 `}` + `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` `(` FormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` - `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` `(` FormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` AsyncMethod[Yield, Await] : - `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` StrictFormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` StrictFormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` AsyncFunctionBody : - FunctionBody[~Yield, +Await] + FunctionBody[~Yield, +Await] AwaitExpression[Yield] : - `await` UnaryExpression[?Yield, +Await] + `await` UnaryExpression[?Yield, +Await] @@ -19439,25 +19439,25 @@

    Async Arrow Function Definitions

    Syntax

    AsyncArrowFunction[In, Yield, Await] : - `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover AsyncConciseBody[In, ?Yield] : - [lookahead != `{`] AssignmentExpression[?In, ?Yield, +Await] - `{` AsyncFunctionBody `}` + [lookahead != `{`] AssignmentExpression[?In, ?Yield, +Await] + `{` AsyncFunctionBody `}` AsyncArrowBindingIdentifier[Yield] : - BindingIdentifier[?Yield, +Await] + BindingIdentifier[?Yield, +Await] CoverCallExpressionAndAsyncArrowHead[Yield, Await] : - MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] + MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]

    Supplemental Syntax

    When processing the production AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

    - AsyncArrowHead : - `async` [no LineTerminator here] ArrowFormalParameters[Await] + AsyncArrowHead : + `async` [no LineTerminator here] ArrowFormalParameters[Await] @@ -35573,9 +35573,9 @@

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    When the `AsyncFunction` function is called with some arguments _p1_, _p2_, ..., _pn_, _body_ (where _n_ might be 0, that is, there are no _p_ arguments, and where _body_ might also not be provided), the following steps are taken:

    - 1. Let _C_ be the active function object. - 2. Let _args_ be the argumentsList that was passed to this function by [[Call]] or [[Construct]]. - 3. Return CreateDynamicFunction(_C_, NewTarget, "async", _args_). + 1. Let _C_ be the active function object. + 2. Let _args_ be the argumentsList that was passed to this function by [[Call]] or [[Construct]]. + 3. Return CreateDynamicFunction(_C_, NewTarget, "async", _args_). See note for 19.2.1.1 From 23eb7f5c36862c82a83bc26b80f5988706e42649 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:11:01 -0400 Subject: [PATCH 07/42] Delete extraneous double-quote. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 9081bbfb21..f4bafff36d 100644 --- a/spec.html +++ b/spec.html @@ -11598,7 +11598,7 @@

    Syntax

    CallExpression[?Yield, ?Await] `[` Expression[+In, ?Yield, ?Await] `]` CallExpression[?Yield, ?Await] `.` IdentifierName CallExpression[?Yield, ?Await] TemplateLiteral[?Yield, ?Await] -" + SuperCall[Yield, Await] : `super` Arguments[?Yield, ?Await] From 794d9b004b76728590b0d0f8c3fd0b199ebab092 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:14:36 -0400 Subject: [PATCH 08/42] Replace non-ASCII characters with entity-references ... specifically «, », and …, for consistency with rest of spec. --- spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec.html b/spec.html index f4bafff36d..6dfea2f1eb 100644 --- a/spec.html +++ b/spec.html @@ -19228,7 +19228,7 @@

    Static Semantics: BoundNames

    AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - 1. Return «`"*default*"`». + 1. Return «`"*default*"`». "`*default*`" is used within this specification as a synthetic name for hoistable anonymous functions that are defined using export declarations.
    @@ -19355,7 +19355,7 @@

    Runtime Semantics: EvaluateBody

    1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _FunctionBody_). 1. Else _declResult_ is an abrupt completion - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}.
    @@ -19639,7 +19639,7 @@

    Runtime Semantics: EvaluateBody

    1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _AssignmentExpression_). 1. Else _declResult_ is an abrupt completion - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}. @@ -35561,7 +35561,7 @@

    Async Function Objects

    The Async Function Constructor

    -

    The `AsyncFunction` Constructor is the %AsyncFunction% intrinsic object and is a subclass of `Function`. When `AsyncFunction` is called as a function rather than as a constructor, it creates and initializes a new AsyncFunction object. Thus the function call `AsyncFunction(…)` is equivalent to the object creation expression `new AsyncFunction(…)` with the same arguments.

    +

    The `AsyncFunction` Constructor is the %AsyncFunction% intrinsic object and is a subclass of `Function`. When `AsyncFunction` is called as a function rather than as a constructor, it creates and initializes a new AsyncFunction object. Thus the function call `AsyncFunction(…)` is equivalent to the object creation expression `new AsyncFunction(…)` with the same arguments.

    The `AsyncFunction` constructor is designed to be subclassable. It may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified AsyncFunction behaviour must include a super call to the AsyncFunction constructor to create and initialize a subclass instances with the internal slots necessary for built-in async function behaviour.

    @@ -35674,12 +35674,12 @@

    AsyncFunctionStart ( _promiseCapability_, |asyncFunctionBody| )

    1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done. 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. If _result_.[[type]] is ~normal~, then - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «*undefined*»). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «*undefined*»). 1. Else if _result_.[[type]] is ~return~, then - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «_result_.[[value]]»). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, «_result_.[[value]]»). 1. Else, 1. Assert: _result_.[[type]] is ~throw~. - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_result_.[[value]]»). + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_result_.[[value]]»). 1. Return. 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. 1. Resume the suspended evaluation of _asyncContext_. Let _result_ be the value returned by the resumed computation. @@ -35694,7 +35694,7 @@

    AsyncFunctionAwait ( _value_ )

    1. Let _asyncContext_ be the running execution context. 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). + 1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). 1. Let _onFulfilled_ be a new built-in function object as defined in . 1. Let _onRejected_ be a new built-in function object as defined in . 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. From f37847a9b0b7f47ab0892d8734cc2397d4b15628 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:18:19 -0400 Subject: [PATCH 09/42] Delete extraneous

. --- spec.html | 1 - 1 file changed, 1 deletion(-) diff --git a/spec.html b/spec.html index 6dfea2f1eb..a8428214f6 100644 --- a/spec.html +++ b/spec.html @@ -10554,7 +10554,6 @@

Static Semantics: Early Errors

It is a Syntax Error if this production has an [Await] parameter and StringValue of |Identifier| is `"await"`. - Identifier : IdentifierName but not ReservedWord
  • From ecb4e21b350a85bddbe14f8f4ce47418cd681d89 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:34:27 -0400 Subject: [PATCH 10/42] Add end-tags for elements that allow them ... specifically
  • and

    , for consistency with the rest of the spec. --- spec.html | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/spec.html b/spec.html index a8428214f6..0ee4d7fdf2 100644 --- a/spec.html +++ b/spec.html @@ -19192,9 +19192,9 @@

    Static Semantics: Early Errors

    • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |StrictFormalParameters| is *false*.
    • -
    • It is a Syntax Error if HasDirectSuper of |AsyncMethod| is *true*. -
    • It is a Syntax Error if |StrictFormalParameters| Contains |AwaitExpression| is *true*. -
    • It is a Syntax Error if any element of the BoundNames of |StrictFormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody| +
    • It is a Syntax Error if HasDirectSuper of |AsyncMethod| is *true*.
    • +
    • It is a Syntax Error if |StrictFormalParameters| Contains |AwaitExpression| is *true*.
    • +
    • It is a Syntax Error if any element of the BoundNames of |StrictFormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|
    AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` @@ -19204,14 +19204,14 @@

    Static Semantics: Early Errors

    • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
    • -
    • It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*. -
    • If the source code matching this production is strict code, the Early Error rules for |StrictFormalParameters| : |FormalParameters| are applied. -
    • If the source code matching this production is strict code, it is a Syntax Error if |BindingIdentifier| is the |IdentifierName| `eval` or the |IdentifierName| `arguments`. -
    • It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|. -
    • It is a Syntax Error if |FormalParameters| contains |SuperProperty| is *true*. -
    • It is a Syntax Error if |AsyncFunctionBody| contains |SuperProperty| is *true*. -
    • It is a Syntax Error if |FormalParameters| contains |SuperCall| is *true*. -
    • It is a Syntax Error if |AsyncFunctionBody| contains |SuperCall| is *true*. +
    • It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.
    • +
    • If the source code matching this production is strict code, the Early Error rules for |StrictFormalParameters| : |FormalParameters| are applied.
    • +
    • If the source code matching this production is strict code, it is a Syntax Error if |BindingIdentifier| is the |IdentifierName| `eval` or the |IdentifierName| `arguments`.
    • +
    • It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.
    • +
    • It is a Syntax Error if |FormalParameters| contains |SuperProperty| is *true*.
    • +
    • It is a Syntax Error if |AsyncFunctionBody| contains |SuperProperty| is *true*.
    • +
    • It is a Syntax Error if |FormalParameters| contains |SuperCall| is *true*.
    • +
    • It is a Syntax Error if |AsyncFunctionBody| contains |SuperCall| is *true*.
    @@ -19466,15 +19466,15 @@

    Static Semantics: Early Errors

    • It is a Syntax Error if ContainsUseStrict of |AsyncConciseBody| is *true* and IsSimpleParameterList of |ArrowParameters| is *false*.
    • -
    • It is a Syntax Error if any element of the BoundNames of |AsyncArrowBindingIdentifier| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|. +
    • It is a Syntax Error if any element of the BoundNames of |AsyncArrowBindingIdentifier| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|.
    AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody
      -
    • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |YieldExpression| is *true*. -
    • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |AwaitExpression| is *true*. -
    • It is a Syntax Error if any element of the BoundNames of |CoverCallExpressionAndAsyncArrowHead| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|. +
    • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |YieldExpression| is *true*.
    • +
    • It is a Syntax Error if |CoverCallExpressionAndAsyncArrowHead| Contains |AwaitExpression| is *true*.
    • +
    • It is a Syntax Error if any element of the BoundNames of |CoverCallExpressionAndAsyncArrowHead| also occurs in the LexicallyDeclaredNames of |AsyncConciseBody|.
    • It is a Syntax Error if the lexical token sequence matched by |CoverCallExpressionAndAsyncArrowHead| cannot be parsed with no tokens left over using |AsyncArrowHead| as the goal symbol.
    • All Early Error rules for |AsyncArrowHead| and its derived productions apply to CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|.
    @@ -35567,7 +35567,7 @@

    The Async Function Constructor

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    -

    The last argument specifies the body (executable code) of an async function. Any preceding arguments specify formal parameters. +

    The last argument specifies the body (executable code) of an async function. Any preceding arguments specify formal parameters.

    When the `AsyncFunction` function is called with some arguments _p1_, _p2_, ..., _pn_, _body_ (where _n_ might be 0, that is, there are no _p_ arguments, and where _body_ might also not be provided), the following steps are taken:

    @@ -35583,11 +35583,11 @@

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    Properties of the AsyncFunction constructor

    -

    The AsyncFunction constructor is a standard built-in function object that inherits from the `Function` constructor. The value of the [[Prototype]] internal slot of the AsyncFunction constructor is the intrinsic object %Function%. +

    The AsyncFunction constructor is a standard built-in function object that inherits from the `Function` constructor. The value of the [[Prototype]] internal slot of the AsyncFunction constructor is the intrinsic object %Function%.

    -

    The value of the [[Extensible]] internal slot of the AsyncFunction constructor is *true*. +

    The value of the [[Extensible]] internal slot of the AsyncFunction constructor is *true*.

    -

    The value of the *name* property of the AsyncFunction is "AsyncFunction". +

    The value of the *name* property of the AsyncFunction is "AsyncFunction".

    The AsyncFunction constructor has the following properties:

    From 0de8558aadfb08829dedc50bfea5c9e2e058bb12 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:40:48 -0400 Subject: [PATCH 11/42] Replace emu-nt and emu-t tags with ecmarkdown chars. --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 0ee4d7fdf2..bcc2a94ccf 100644 --- a/spec.html +++ b/spec.html @@ -19509,14 +19509,14 @@

    Static Semantics: Contains

    AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody - 1. If _symbol_ is not one of NewTarget, SuperProperty, SuperCall, super, or this, return *false*. + 1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|, `super`, or `this`, return *false*. 1. Return |AsyncConciseBody| contains _symbol_. AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody - 1. If _symbol_ is not one of NewTarget, SuperProperty, SuperCall, super, or this, return *false*. + 1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|, `super`, or `this`, return *false*. 2. Let _head_ be CoveredAsyncFunctionHead of |CoverCallExpressionAndAsyncArrowHead|. 3. If _head_ Contains _symbol_ is *true*, return *true*. 4. Return |AsyncConciseBody| Contains _symbol_. From 99841455a8263702028122c1f54bd14a3cfc1fd8 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:53:35 -0400 Subject: [PATCH 12/42] Minor tweaks to clause titles for consistency. --- spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index bcc2a94ccf..5c134fc2b1 100644 --- a/spec.html +++ b/spec.html @@ -35556,9 +35556,9 @@

    Properties of Promise Instances

    -

    Async Function Objects

    +

    AsyncFunction Objects

    -

    The Async Function Constructor

    +

    The AsyncFunction Constructor

    The `AsyncFunction` Constructor is the %AsyncFunction% intrinsic object and is a subclass of `Function`. When `AsyncFunction` is called as a function rather than as a constructor, it creates and initializes a new AsyncFunction object. Thus the function call `AsyncFunction(…)` is equivalent to the object creation expression `new AsyncFunction(…)` with the same arguments.

    @@ -35581,7 +35581,7 @@

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    -

    Properties of the AsyncFunction constructor

    +

    Properties of the AsyncFunction Constructor

    The AsyncFunction constructor is a standard built-in function object that inherits from the `Function` constructor. The value of the [[Prototype]] internal slot of the AsyncFunction constructor is the intrinsic object %Function%.

    @@ -35622,7 +35622,7 @@

    AsyncFunction.prototype.constructor

    -

    AsyncFunction.prototype[@@toStringTag]

    +

    AsyncFunction.prototype [ @@toStringTag ]

    The initial value of the @@toStringTag property is the string value "AsyncFunction".

    From c0a4b3fae01d656656c5ee1998a42c2385b9be88 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 15:57:12 -0400 Subject: [PATCH 13/42] In AsyncFunction(), change "..." to "…" ... for consistency with Function() and GeneratorFunction(). --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 5c134fc2b1..1826178f61 100644 --- a/spec.html +++ b/spec.html @@ -35565,11 +35565,11 @@

    The AsyncFunction Constructor

    The `AsyncFunction` constructor is designed to be subclassable. It may be used as the value of an extends clause of a class definition. Subclass constructors that intend to inherit the specified AsyncFunction behaviour must include a super call to the AsyncFunction constructor to create and initialize a subclass instances with the internal slots necessary for built-in async function behaviour.

    -

    AsyncFunction(_p1_, _p2_, ..., _pn_, _body_)

    +

    AsyncFunction(_p1_, _p2_, … , _pn_, _body_)

    The last argument specifies the body (executable code) of an async function. Any preceding arguments specify formal parameters.

    -

    When the `AsyncFunction` function is called with some arguments _p1_, _p2_, ..., _pn_, _body_ (where _n_ might be 0, that is, there are no _p_ arguments, and where _body_ might also not be provided), the following steps are taken:

    +

    When the `AsyncFunction` function is called with some arguments _p1_, _p2_, …, _pn_, _body_ (where _n_ might be 0, that is, there are no _p_ arguments, and where _body_ might also not be provided), the following steps are taken:

    1. Let _C_ be the active function object. From cec3c583a08004d10c9b7eb11f2e31422d64b2a2 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 16:04:59 -0400 Subject: [PATCH 14/42] Fix misuse of |Nonterminal| notation: In AsyncFunctionCreate(): |ParameterList| --> _parameters_ |Body| --> _body_ In AsyncFunctionStart(): |asyncFunctionBody| --> _asyncFunctionBody_ (but only in the header, as it's already correct in the algorithm). --- spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 1826178f61..af54d22ae4 100644 --- a/spec.html +++ b/spec.html @@ -35654,17 +35654,17 @@

    name

    Async Functions Abstract Operations

    -

    AsyncFunctionCreate ( _kind_, |ParameterList|, |Body|, _Scope_, _Strict_ )

    -

    The abstract operation AsyncFunctionCreate requires the arguments: _kind_ which is one of (~Normal~, ~Method~, ~Arrow~), a parameter list production specified by |ParameterList|, a body production specified by |Body|, a Lexical Environment specified by _Scope_, and a Boolean flag _Strict_. AsyncFunctionCreate performs the following steps:

    +

    AsyncFunctionCreate ( _kind_, _parameters_, _body_, _Scope_, _Strict_ )

    +

    The abstract operation AsyncFunctionCreate requires the arguments: _kind_ which is one of (~Normal~, ~Method~, ~Arrow~), a parameter list production specified by _parameters_, a body production specified by _body_, a Lexical Environment specified by _Scope_, and a Boolean flag _Strict_. AsyncFunctionCreate performs the following steps:

    1. Let _functionPrototype_ be the intrinsic object %AsyncFunctionPrototype%. 2. Let _F_ be ! FunctionAllocate(_functionPrototype_, _Strict_, `"non-constructor"`). - 3. Return ! FunctionInitialize(_F_, _kind_, |ParameterList|, |Body|, _Scope_). + 3. Return ! FunctionInitialize(_F_, _kind_, _parameters_, _body_, _Scope_).
    -

    AsyncFunctionStart ( _promiseCapability_, |asyncFunctionBody| )

    +

    AsyncFunctionStart ( _promiseCapability_, _asyncFunctionBody_ )

    1. Let _runningContext_ be the running execution context. 1. Let _asyncContext_ be a copy of _runningContext_. From a45b288c0b8f4586102fe91a5042cedf312695be Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 16:47:18 -0400 Subject: [PATCH 15/42] In , insert blank line between productions. --- spec.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec.html b/spec.html index af54d22ae4..0beb971d5b 100644 --- a/spec.html +++ b/spec.html @@ -19198,8 +19198,11 @@

    Static Semantics: Early Errors

AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
    @@ -19248,8 +19251,11 @@

    Static Semantics: Contains

    With parameter _symbol_.

    AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` @@ -19288,6 +19294,7 @@

    Static Semantics: HasName

    Static Semantics: IsConstantDeclaration

    AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` @@ -19299,6 +19306,7 @@

    Static Semantics: IsConstantDeclaration

    Static Semantics: IsFunctionDefinition

    AsyncFunctionExpression : `async` [no LineTerminator here] `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` + AsyncFunctionExpression : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` @@ -19548,6 +19556,7 @@

    Static Semantics: ExpectedArgumentCount

    Static Semantics: HasName

    AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody + AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody From 2972d8c0b58b1593fff3cb82168185969a8e3e79 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 16:52:08 -0400 Subject: [PATCH 16/42] Insert missing backtick in production. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 0beb971d5b..88c77798c5 100644 --- a/spec.html +++ b/spec.html @@ -19651,7 +19651,7 @@

    Runtime Semantics: EvaluateBody

    1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}.
    - AsyncConciseBody : {` AsyncFunctionBody `}` + AsyncConciseBody : `{` AsyncFunctionBody `}` 1. Return the result of calling EvaluateBody of |AsyncFunctionBody| passing _functionObject_ and _argumentsList_ as the arguments. From 9be7e20eee7bd923563d859e0b119eae8ae22b81 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 16:55:41 -0400 Subject: [PATCH 17/42] Use correct number of colons in production --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 88c77798c5..394f1ac05b 100644 --- a/spec.html +++ b/spec.html @@ -19431,7 +19431,7 @@

    Runtime Semantics: Evaluation

    - AwaitExpression :: `await` UnaryExpression + AwaitExpression : `await` UnaryExpression 1. Let _exprRef_ be the result of evaluating |UnaryExpression|. From 123dd9aec3231e2a169e136b15eb347d956df566 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 16:58:51 -0400 Subject: [PATCH 18/42] Rename 'StrictFormalParameters' as 'UniqueFormalParameters' --- spec.html | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec.html b/spec.html index 394f1ac05b..9abdf2a5da 100644 --- a/spec.html +++ b/spec.html @@ -19159,7 +19159,7 @@

    Syntax

    `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` AsyncMethod[Yield, Await] : - `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` StrictFormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` AsyncFunctionBody : FunctionBody[~Yield, +Await] @@ -19188,13 +19188,13 @@

    Syntax

    Static Semantics: Early Errors

    - AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}`
      -
    • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |StrictFormalParameters| is *false*.
    • +
    • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |UniqueFormalParameters| is *false*.
    • It is a Syntax Error if HasDirectSuper of |AsyncMethod| is *true*.
    • -
    • It is a Syntax Error if |StrictFormalParameters| Contains |AwaitExpression| is *true*.
    • -
    • It is a Syntax Error if any element of the BoundNames of |StrictFormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|
    • +
    • It is a Syntax Error if |UniqueFormalParameters| Contains |AwaitExpression| is *true*.
    • +
    • It is a Syntax Error if any element of the BoundNames of |UniqueFormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|
    AsyncFunctionDeclaration : `async` [no LineTerminator here] `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` @@ -19208,7 +19208,7 @@

    Static Semantics: Early Errors

    • It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
    • It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.
    • -
    • If the source code matching this production is strict code, the Early Error rules for |StrictFormalParameters| : |FormalParameters| are applied.
    • +
    • If the source code matching this production is strict code, the Early Error rules for |UniqueFormalParameters| : |FormalParameters| are applied.
    • If the source code matching this production is strict code, it is a Syntax Error if |BindingIdentifier| is the |IdentifierName| `eval` or the |IdentifierName| `arguments`.
    • It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.
    • It is a Syntax Error if |FormalParameters| contains |SuperProperty| is *true*.
    • @@ -19239,7 +19239,7 @@

      Static Semantics: BoundNames

      Static Semantics: ComputedPropertyContains

      With parameter _symbol_.

      - AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}` 1. Return the result of ComputedPropertyContains for |PropertyName| with argument _symbol_. @@ -19266,10 +19266,10 @@

      Static Semantics: Contains

      Static Semantics: HasDirectSuper

      - AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}` - 1. If |StrictFormalParameters| Contains |SuperCall| is *true*, return *true*. + 1. If |UniqueFormalParameters| Contains |SuperCall| is *true*, return *true*. 2. Return |AsyncFunctionBody| Contains |SuperCall|.
      @@ -19317,7 +19317,7 @@

      Static Semantics: IsFunctionDefinition

      Static Semantics: PropName

      - AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}` 1. Return PropName of |PropertyName|. @@ -19371,14 +19371,14 @@

      Runtime Semantics: EvaluateBody

      Runtime Semantics: PropertyDefinitionEvaluation

      With parameters _object_ and _enumerable_.

      - AsyncMethod : `async` [no LineTerminator here] PropertyName `(` StrictFormalParameters `)` `{` AsyncFunctionBody `}` + AsyncMethod : `async` [no LineTerminator here] PropertyName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}` 1. Let _propKey_ be the result of evaluating |PropertyName|. 1. ReturnIfAbrupt(_propKey_). 1. If the function code for this |AsyncMethod| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. 1. Let _scope_ be the LexicalEnvironment of the running execution context. - 1. Let _closure_ be ! AsyncFunctionCreate(~Method~, |StrictFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). + 1. Let _closure_ be ! AsyncFunctionCreate(~Method~, |UniqueFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 1. Perform ! MakeMethod(_closure_, _object_). 1. Perform ! SetFunctionName(_closure_, _propKey_). 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncMethod|. From fd906f48604f1281bb77bb420c0f2ea5b68ddf2b Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:28:30 -0400 Subject: [PATCH 19/42] Defining prodn for AssignmentExpression needs RHS for AsyncArrowFunction! --- spec.html | 1 + 1 file changed, 1 insertion(+) diff --git a/spec.html b/spec.html index 9abdf2a5da..9e4e131110 100644 --- a/spec.html +++ b/spec.html @@ -13529,6 +13529,7 @@

      Syntax

      [+Yield] YieldExpression[?In, ?Await] [+Await] AwaitExpression[?In, ?Yield] ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] From 766de6feb2165ee4e539f6f8639b34e319d1289b Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:29:16 -0400 Subject: [PATCH 20/42] Fix 'use' of CallExpression prodn --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 9e4e131110..498b05c60d 100644 --- a/spec.html +++ b/spec.html @@ -19959,7 +19959,7 @@

      Expression Rules

      CallExpression : - MemberExpression Arguments + CoverCallExpressionAndAsyncArrowHead CallExpression Arguments CallExpression TemplateLiteral From 75e24ed41e83e18d3bec0608b1446e815445d4ef Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:33:07 -0400 Subject: [PATCH 21/42] In prodn LHS, param should never have prefix-char. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 498b05c60d..242f12201f 100644 --- a/spec.html +++ b/spec.html @@ -19450,7 +19450,7 @@

      Syntax

      `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover - AsyncConciseBody[In, ?Yield] : + AsyncConciseBody[In, Yield] : [lookahead != `{`] AssignmentExpression[?In, ?Yield, +Await] `{` AsyncFunctionBody `}` From cb8c4bf88ee39c15122fc98e88eff0c54b57d17c Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:37:29 -0400 Subject: [PATCH 22/42] In prodn RHS, param must always have prefix-char. (Please check that the prefix-char I've inserted is what you intended.) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 242f12201f..aed543ac2c 100644 --- a/spec.html +++ b/spec.html @@ -19152,8 +19152,8 @@

      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 `}` + `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` `(` FormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` @@ -19465,7 +19465,7 @@

      Supplemental Syntax

      AsyncArrowHead : - `async` [no LineTerminator here] ArrowFormalParameters[Await] + `async` [no LineTerminator here] ArrowFormalParameters[+Await] From e70a8344a26831c3554de04d36a9b3337e3993d7 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:45:46 -0400 Subject: [PATCH 23/42] AwaitExpression invoked with an In param, which it doesn't take. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index aed543ac2c..d19991df41 100644 --- a/spec.html +++ b/spec.html @@ -13527,7 +13527,7 @@

      Syntax

      AssignmentExpression[In, Yield, Await] : ConditionalExpression[?In, ?Yield, ?Await] [+Yield] YieldExpression[?In, ?Await] - [+Await] AwaitExpression[?In, ?Yield] + [+Await] AwaitExpression[?Yield] ArrowFunction[?In, ?Yield, ?Await] AsyncArrowFunction[?In, ?Yield, ?Await] LeftHandSideExpression[?Yield, ?Await] `=` AssignmentExpression[?In, ?Yield, ?Await] #assignment From 5d349f555ac8a1e3b376770c7095c6e70300fb17 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:49:10 -0400 Subject: [PATCH 24/42] AssignmentProperty appears to want an 'Await' param (Please check that I've added it as intended.) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index d19991df41..a175f01eb5 100644 --- a/spec.html +++ b/spec.html @@ -13666,9 +13666,9 @@

      Supplemental Syntax

      AssignmentElisionElement[Yield, Await] : Elision? AssignmentElement[?Yield, ?Await] - AssignmentProperty[Yield] : - IdentifierReference[?Yield] Initializer[+In, ?Yield]? - PropertyName[?Yield] `:` AssignmentElement[?Yield] + AssignmentProperty[Yield, Await] : + IdentifierReference[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? + PropertyName[?Yield, ?Await] `:` AssignmentElement[?Yield, ?Await] AssignmentElement[Yield, Await] : DestructuringAssignmentTarget[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]? From fea764482e47e47d97965bd06f2900613f8942f0 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:52:23 -0400 Subject: [PATCH 25/42] 3 cases where a nonterminal was 'invoked' with less than its full set of params (Please check.) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index a175f01eb5..348609b921 100644 --- a/spec.html +++ b/spec.html @@ -15267,7 +15267,7 @@

      Expression Statement

      Syntax

      ExpressionStatement[Yield, Await] : - [lookahead <! {`{`, `function`, `async` [no |LineTerminator| here] `function`, `class`, `let [`}] Expression[+In, ?Yield] `;` + [lookahead <! {`{`, `function`, `async` [no |LineTerminator| here] `function`, `class`, `let [`}] Expression[+In, ?Yield, ?Await] `;`

      An |ExpressionStatement| cannot start with a U+007B (LEFT CURLY BRACKET) because that might make it ambiguous with a |Block|. An |ExpressionStatement| cannot start with the `function` or `class` keywords because that would make it ambiguous with a |FunctionDeclaration|, a |GeneratorDeclaration|, or a |ClassDeclaration|. An |ExpressionStatement| cannot start with `async function` because that would make it ambiguous with an |AsyncFunctionExpression|. An |ExpressionStatement| cannot start with the two token sequence `let [` because that would make it ambiguous with a `let` |LexicalDeclaration| whose first |LexicalBinding| was an |ArrayBindingPattern|.

      @@ -19448,7 +19448,7 @@

      Syntax

      AsyncArrowFunction[In, Yield, Await] : `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In, ?Yield] #callcover AsyncConciseBody[In, Yield] : [lookahead != `{`] AssignmentExpression[?In, ?Yield, +Await] @@ -19465,7 +19465,7 @@

      Supplemental Syntax

      AsyncArrowHead : - `async` [no LineTerminator here] ArrowFormalParameters[+Await] + `async` [no LineTerminator here] ArrowFormalParameters[+Yield, +Await] From 2c1e6badfbdaf90e97483d9c02976d27a45baaa3 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 17:56:57 -0400 Subject: [PATCH 26/42] Illegal use of '?' param-prefix in RHS (That is, [?Foo] appears in RHS, but production doesn't have [Foo] in its LHS.) In each of 3 spots, I changed the '?' to '~'. Please check. --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 348609b921..2f6a4da20c 100644 --- a/spec.html +++ b/spec.html @@ -18442,7 +18442,7 @@

      Syntax

      [+Default] `function` `*` `(` FormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` GeneratorExpression : - `function` `*` BindingIdentifier[+Yield, ?Await]? `(` FormalParameters[+Yield, ?Await] `)` `{` GeneratorBody `}` + `function` `*` BindingIdentifier[+Yield, ~Await]? `(` FormalParameters[+Yield, ~Await] `)` `{` GeneratorBody `}` GeneratorBody : FunctionBody[+Yield, ~Await] @@ -19156,7 +19156,7 @@

      Syntax

      [+Default] `async` [no LineTerminator here] `function` `(` FormalParameters[?Yield, ?Await] `)` `{` AsyncFunctionBody `}` AsyncFunctionExpression : - `async` [no LineTerminator here] `function` `(` FormalParameters[?Yield, +Await] `)` `{` AsyncFunctionBody `}` + `async` [no LineTerminator here] `function` `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` `async` [no LineTerminator here] `function` BindingIdentifier[~Yield, +Await] `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}` AsyncMethod[Yield, Await] : From 446c064d2ca56a895f2c96ec7fd659bcd4ffb71d Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:04:36 -0400 Subject: [PATCH 27/42] Suppress params from RHS, since they're already suppressed in LHS. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 2f6a4da20c..9e727ebf41 100644 --- a/spec.html +++ b/spec.html @@ -19619,7 +19619,7 @@

      Static Semantics: VarScopedDeclarations

      Runtime Semantics: IteratorBindingInitialization

      With parameters _iteratorRecord_ and _environment_.

      - AsyncArrowBindingIdentifier : BindingIdentifier[?Yield, +Await] + AsyncArrowBindingIdentifier : BindingIdentifier 1. Assert: _iteratorRecord_.[[done]] is *false*. From 6c113a09e5d902304bff39a7fbdc1e2c1cb4daef Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:07:48 -0400 Subject: [PATCH 28/42] AssignmentPattern takes Await as well as Yield. Reword the alg-step to mention both params, and be more explicit about where the 'values' of the params come from (using phrasing that appears elsewhere). --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 9e727ebf41..e8d5156b80 100644 --- a/spec.html +++ b/spec.html @@ -13612,7 +13612,7 @@

      Runtime Semantics: Evaluation

      1. If _hasNameProperty_ is *false*, perform SetFunctionName(_rval_, GetReferencedName(_lref_)). 1. Perform ? PutValue(_lref_, _rval_). 1. Return _rval_. - 1. Let _assignmentPattern_ be the parse of the source text corresponding to |LeftHandSideExpression| using |AssignmentPattern[?Yield]| as the goal symbol. + 1. Let _assignmentPattern_ be the parse of the source text corresponding to |LeftHandSideExpression| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing |LeftHandSideExpression|. 1. Let _rref_ be the result of evaluating |AssignmentExpression|. 1. Let _rval_ be ? GetValue(_rref_). 1. Let _status_ be the result of performing DestructuringAssignmentEvaluation of _assignmentPattern_ using _rval_ as the argument. From 5bb759114df5e30d62a02ae8115ffd1cb7cf6b00 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:13:12 -0400 Subject: [PATCH 29/42] FunctionDeclaration takes Await as well as Yield and Default --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index e8d5156b80..a8cd0e8f9d 100644 --- a/spec.html +++ b/spec.html @@ -37439,7 +37439,7 @@

      FunctionDeclarations in IfStatement Statement Clauses

      `if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default] `else` FunctionDeclaration[?Yield, ?Await, ~Default] `if` `(` Expression[+In, ?Yield, ?Await] `)` FunctionDeclaration[?Yield, ?Await, ~Default]
      -

      This production only applies when parsing non-strict code. Code matching this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in .

      +

      This production only applies when parsing non-strict code. Code matching this production is processed as if each matching occurrence of |FunctionDeclaration[?Yield, ?Await, ~Default]| was the sole |StatementListItem| of a |BlockStatement| occupying that position in the source code. The semantics of such a synthetic |BlockStatement| includes the web legacy compatibility semantics specified in .

      From 405f767c52b82952ee060e6ae06ec3883957acb1 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:16:01 -0400 Subject: [PATCH 30/42] Keyword prodn: put 'await' on the same line as all the others --- spec.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec.html b/spec.html index a8cd0e8f9d..2b882593f5 100644 --- a/spec.html +++ b/spec.html @@ -9387,8 +9387,7 @@

      Keywords

      Syntax

      Keyword :: one of - `break` `do` `in` `typeof` `case` `else` `instanceof` `var` `catch` `export` `new` `void` `class` `extends` `return` `while` `const` `finally` `super` `with` `continue` `for` `switch` `yield` `debugger` `function` `this` `default` `if` `throw` `delete` `import` `try` - `await` + `break` `do` `in` `typeof` `case` `else` `instanceof` `var` `catch` `export` `new` `void` `class` `extends` `return` `while` `const` `finally` `super` `with` `continue` `for` `switch` `yield` `debugger` `function` `this` `default` `if` `throw` `delete` `import` `try` `await`

      In some contexts `yield` is given the semantics of an |Identifier|. See . In strict mode code, `let` and `static` are treated as reserved keywords through static semantic restrictions (see , , , and ) rather than the lexical grammar.

      From 106a1f935d668e60f3f2273a2c5de72435336c15 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:20:00 -0400 Subject: [PATCH 31/42] Change "Set the [[SourceText]] internal slot of _foo_" ... to "Set _foo_.[[SourceText]]" --- spec.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec.html b/spec.html index 2b882593f5..1d466ce0a7 100644 --- a/spec.html +++ b/spec.html @@ -19335,7 +19335,7 @@

      Runtime Semantics: InstantiateFunctionObject

      2. Let _name_ be StringValue of |BindingIdentifier| 3. Let _F_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 4. Perform ! SetFunctionName(_F_, _name_). - 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. + 1. Set _F_.[[SourceText]] to the source text matched by |AsyncFunctionDeclaration|. 5. Return _F_.
      @@ -19345,7 +19345,7 @@

      Runtime Semantics: InstantiateFunctionObject

      1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. 2. Let _F_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 3. Perform ! SetFunctionName(_F_, `"default"`). - 1. Set the [[SourceText]] internal slot of _F_ to the source text matched by |AsyncFunctionDeclaration|. + 1. Set _F_.[[SourceText]] to the source text matched by |AsyncFunctionDeclaration|. 4. Return _F_.
      @@ -19381,7 +19381,7 @@

      Runtime Semantics: PropertyDefinitionEvaluation

      1. Let _closure_ be ! AsyncFunctionCreate(~Method~, |UniqueFormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 1. Perform ! MakeMethod(_closure_, _object_). 1. Perform ! SetFunctionName(_closure_, _propKey_). - 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncMethod|. + 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncMethod|. 1. Let _desc_ be the Property Descriptor{[[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true*}. 1. Return ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). @@ -19409,7 +19409,7 @@

      Runtime Semantics: Evaluation

      1. If the function code for |AsyncFunctionExpression| is strict mode code, let _strict_ be *true*. Otherwise let _strict_ be *false*. 1. Let _scope_ be the LexicalEnvironment of the running execution context. 1. Let _closure_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). - 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. + 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncFunctionExpression|. 1. Return _closure_. @@ -19424,7 +19424,7 @@

      Runtime Semantics: Evaluation

      1. Let _name_ be StringValue of |BindingIdentifier|. 1. Perform ! _envRec_.CreateImmutableBinding( _name_). 1. Let _closure_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _funcEnv_, _strict_). - 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncFunctionExpression|. + 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncFunctionExpression|. 1. Perform ! SetFunctionName(_closure_, _name_). 1. Perform ! _envRec_.InitializeBinding( _name_, _closure_). 1. Return _closure_. @@ -19668,7 +19668,7 @@

      Runtime Semantics: Evaluation

      2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _parameters_ be |AsyncArrowBindingIdentifier|. 4. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). - 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. + 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncArrowFunction|. 5. Return _closure_. @@ -19680,7 +19680,7 @@

      Runtime Semantics: Evaluation

      3. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|. 4. Let _parameters_ be the |ArrowFormalParameters| production matched by _head_. 5. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). - 1. Set the [[SourceText]] internal slot of _closure_ to the source text matched by |AsyncArrowFunction|. + 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncArrowFunction|. 6. Return _closure_. From 03e47d49abadd59af823ee1d0f531e69c39df685 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:22:28 -0400 Subject: [PATCH 32/42] Change "the value of _F_'s [[AsyncContext]] internal slot" ... to "_F_.[[AsyncContext]]" --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 1d466ce0a7..42e26bb066 100644 --- a/spec.html +++ b/spec.html @@ -35721,7 +35721,7 @@

      AsyncFunctionAwait ( _value_ )

      AsyncFunction Awaited Fulfilled

      Function _F_ is called with the parameter _value_.

      - 1. Let _asyncContext_ be the value of _F_'s [[AsyncContext]] internal slot. + 1. Let _asyncContext_ be _F_.[[AsyncContext]]. 1. Let _prevContext_ be the running execution context. 1. Suspend _prevContext_. 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. @@ -35735,7 +35735,7 @@

      AsyncFunction Awaited Fulfilled

      AsyncFunction Awaited Rejected

      Function _F_ is called with the parameter _reason_.

      - 1. Let _asyncContext_ be the value of _F_'s [[AsyncContext]] internal slot. + 1. Let _asyncContext_ be _F_.[[AsyncContext]]. 1. Let _prevContext_ be the running execution context. 1. Suspend _prevContext_. 1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context. From 5a2993effddf9e1ba257d8c234209bbb9afb8cf0 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:24:13 -0400 Subject: [PATCH 33/42] Split one odd step into two simple steps. --- spec.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 42e26bb066..d3258a0bd3 100644 --- a/spec.html +++ b/spec.html @@ -35705,7 +35705,8 @@

      AsyncFunctionAwait ( _value_ )

      1. Let _resolveResult_ be ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _value_ »). 1. Let _onFulfilled_ be a new built-in function object as defined in . 1. Let _onRejected_ be a new built-in function object as defined in . - 1. Set _onFulfilled_ and _onRejected_'s [[AsyncContext]] internal slots to _asyncContext_. + 1. Set _onFulfilled_.[[AsyncContext]] to _asyncContext_. + 1. Set _onRejected_.[[AsyncContext]] to _asyncContext_. 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. From ccf450fd4d2e34874efbdb3b21a033af6469dfba Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:27:34 -0400 Subject: [PATCH 34/42] punctuation in algorithms --- spec.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec.html b/spec.html index d3258a0bd3..617091a1c6 100644 --- a/spec.html +++ b/spec.html @@ -19332,7 +19332,7 @@

      Runtime Semantics: InstantiateFunctionObject

      1. If the function code for |AsyncFunctionDeclaration| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. - 2. Let _name_ be StringValue of |BindingIdentifier| + 2. Let _name_ be StringValue of |BindingIdentifier|. 3. Let _F_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _scope_, _strict_). 4. Perform ! SetFunctionName(_F_, _name_). 1. Set _F_.[[SourceText]] to the source text matched by |AsyncFunctionDeclaration|. @@ -19361,7 +19361,7 @@

      Runtime Semantics: EvaluateBody

      1. Let _declResult_ be FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _FunctionBody_). - 1. Else _declResult_ is an abrupt completion + 1. Else _declResult_ is an abrupt completion, 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}.
      @@ -19626,7 +19626,7 @@

      Runtime Semantics: IteratorBindingInitialization

      1. If _next_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. 1. ReturnIfAbrupt(_next_). 1. If _next_ is *false*, set _iteratorRecord_.[[done]] to true. - 1. Else + 1. Else, 1. Let _v_ be ? IteratorValue(_next_). 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. 1. ReturnIfAbrupt(_v_). @@ -19646,7 +19646,7 @@

      Runtime Semantics: EvaluateBody

      1. Let _declResult_ be ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. If _declResult_ is not an abrupt completion, then 1. Perform ! AsyncFunctionStart(_promiseCapability_, _AssignmentExpression_). - 1. Else _declResult_ is an abrupt completion + 1. Else _declResult_ is an abrupt completion, 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, «_declResult_.[[value]]»). 1. Return Completion{[[type]]: ~return~, [[value]]: _promiseCapability_.[[Promise]], [[target]]: ~empty~}. @@ -23664,12 +23664,12 @@

      Runtime Semantics: CreateDynamicFunction(_constructor_, _newTarget_, _kind_, 1. Let _goal_ be the grammar symbol |FunctionBody[~Yield, ~Await]|. 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[~Yield, ~Await]|. 1. Let _fallbackProto_ be `"%FunctionPrototype%"`. - 1. Else if _kind_ is `"generator"`, + 1. Else if _kind_ is `"generator"`, then 1. Let _goal_ be the grammar symbol |GeneratorBody|. 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[+Yield, ~Await]|. 1. Let _fallbackProto_ be `"%Generator%"`. 1. Else, - 1. Assert: _kind_ is `"async"` + 1. Assert: _kind_ is `"async"`. 1. Let _goal_ be the grammar symbol |AsyncFunctionBody|. 1. Let _parameterGoal_ be the grammar symbol |FormalParameters[~Yield, +Await]|. 1. Let _fallbackProto_ be `"%AsyncFunctionPrototype%"`. From 84da4437c743bcc96c80260076ed851561f09b7e Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:28:59 -0400 Subject: [PATCH 35/42] ecmarkdown tweaks --- spec.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec.html b/spec.html index 617091a1c6..7b3073c2a8 100644 --- a/spec.html +++ b/spec.html @@ -19548,7 +19548,7 @@

      Static Semantics: ExpectedArgumentCount

      AsyncArrowBindingIdentifier : BindingIdentifier - 1. Return *1*. + 1. Return 1. @@ -19625,7 +19625,7 @@

      Runtime Semantics: IteratorBindingInitialization

      1. Let _next_ be ? IteratorStep(_iteratorRecord_.[[iterator]]). 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. 1. ReturnIfAbrupt(_next_). - 1. If _next_ is *false*, set _iteratorRecord_.[[done]] to true. + 1. If _next_ is *false*, set _iteratorRecord_.[[done]] to *true*. 1. Else, 1. Let _v_ be ? IteratorValue(_next_). 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[done]] to *true*. @@ -19664,7 +19664,7 @@

      Runtime Semantics: Evaluation

      AsyncArrowFunction : `async` [no LineTerminator here] AsyncArrowBindingIdentifier [no LineTerminator here] `=>` AsyncConciseBody - 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be true. Otherwise, let _strict_ be false. + 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. 2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _parameters_ be |AsyncArrowBindingIdentifier|. 4. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). @@ -19675,7 +19675,7 @@

      Runtime Semantics: Evaluation

      AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody - 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be true. Otherwise, let _strict_ be false. + 1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. 2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|. 4. Let _parameters_ be the |ArrowFormalParameters| production matched by _head_. @@ -35582,8 +35582,8 @@

      AsyncFunction(_p1_, _p2_, … , _pn_, _body_)

      1. Let _C_ be the active function object. - 2. Let _args_ be the argumentsList that was passed to this function by [[Call]] or [[Construct]]. - 3. Return CreateDynamicFunction(_C_, NewTarget, "async", _args_). + 2. Let _args_ be the _argumentsList_ that was passed to this function by [[Call]] or [[Construct]]. + 3. Return CreateDynamicFunction(_C_, NewTarget, `"async"`, _args_). See note for 19.2.1.1 From 19a3dfe0f0242e73b3b1226fff3dad4141bb8d68 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:30:41 -0400 Subject: [PATCH 36/42] Tweak wording & capitalization in algorithm steps --- spec.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec.html b/spec.html index 7b3073c2a8..c38a8d1e81 100644 --- a/spec.html +++ b/spec.html @@ -19518,7 +19518,7 @@

      Static Semantics: Contains

      1. If _symbol_ is not one of |NewTarget|, |SuperProperty|, |SuperCall|, `super`, or `this`, return *false*. - 1. Return |AsyncConciseBody| contains _symbol_. + 1. Return |AsyncConciseBody| Contains _symbol_. AsyncArrowFunction : CoverCallExpressionAndAsyncArrowHead [no LineTerminator here] `=>` AsyncConciseBody @@ -19580,7 +19580,7 @@

      Static Semantics: LexicallyDeclaredNames

      AsyncConciseBody : [lookahead != `{`] AssignmentExpression
      - 1. Return an empty List. + 1. Return a new empty List. @@ -19590,7 +19590,7 @@

      Static Semantics: LexicallyScopedDeclarations

      AsyncConciseBody : [lookahead != `{`] AssignmentExpression - 1. Return an empty List. + 1. Return a new empty List. @@ -19600,7 +19600,7 @@

      Static Semantics: VarDeclaredNames

      AsyncConciseBody : [lookahead != `{`] AssignmentExpression - 1. Return an empty List. + 1. Return a new empty List. @@ -19610,7 +19610,7 @@

      Static Semantics: VarScopedDeclarations

      AsyncConciseBody : [lookahead != `{`] AssignmentExpression - 1. Return an empty List. + 1. Return a new empty List. @@ -19654,7 +19654,7 @@

      Runtime Semantics: EvaluateBody

      AsyncConciseBody : `{` AsyncFunctionBody `}` - 1. Return the result of calling EvaluateBody of |AsyncFunctionBody| passing _functionObject_ and _argumentsList_ as the arguments. + 1. Return the result of EvaluateBody of |AsyncFunctionBody| passing _functionObject_ and _argumentsList_ as the arguments. @@ -19678,7 +19678,7 @@

      Runtime Semantics: Evaluation

      1. If the function code for this |AsyncArrowFunction| is strict mode code, let _strict_ be *true*. Otherwise, let _strict_ be *false*. 2. Let _scope_ be the LexicalEnvironment of the running execution context. 3. Let _head_ be CoveredAsyncArrowHead of |CoverCallExpressionAndAsyncArrowHead|. - 4. Let _parameters_ be the |ArrowFormalParameters| production matched by _head_. + 4. Let _parameters_ be the |ArrowFormalParameters| of _head_. 5. Let _closure_ be ! AsyncFunctionCreate(~Arrow~, _parameters_, |AsyncConciseBody|, _scope_, _strict_). 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncArrowFunction|. 6. Return _closure_. @@ -23713,7 +23713,7 @@

      Runtime Semantics: CreateDynamicFunction(_constructor_, _newTarget_, _kind_, 1. Let _prototype_ be ObjectCreate(%GeneratorPrototype%). 1. Perform DefinePropertyOrThrow(_F_, `"prototype"`, PropertyDescriptor{[[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false*}). 1. Else, perform MakeConstructor(_F_). - 1. Note: Async functions are not constructable and do not have a prototype property. + 1. NOTE: Async functions are not constructable and do not have a prototype property. 1. Perform SetFunctionName(_F_, `"anonymous"`). 1. Return _F_. From 9df69a890161173ad7c60b6b9c7aba104a075e7e Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:32:53 -0400 Subject: [PATCH 37/42] Fix "|CoverCallExpressionAndAsyncArrowHead|[Yield, Await]" The params shouldn't be outside the bars, i.e. it should be |CoverCallExpressionAndAsyncArrowHead[Yield, Await]| Except that, the params don't appear in the production, so there's no point putting them in the nonterminal-ref. --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index c38a8d1e81..dd4ec73a19 100644 --- a/spec.html +++ b/spec.html @@ -19495,7 +19495,7 @@

      Static Semantics: CoveredAsyncArrowHead

      CoverCallExpressionAndAsyncArrowHead : MemberExpression Arguments - 1. Return the result of parsing the lexical token stream matched by |CoverCallExpressionAndAsyncArrowHead|[Yield, Await] using |AsyncArrowHead| as the goal symbol. + 1. Return the result of parsing the lexical token stream matched by |CoverCallExpressionAndAsyncArrowHead| using |AsyncArrowHead| as the goal symbol. From edd11c19ab0481f07aebcdec2d2200022986d7b9 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:36:03 -0400 Subject: [PATCH 38/42] Delete spaces from a few algorithm steps. --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index dd4ec73a19..7e32d96337 100644 --- a/spec.html +++ b/spec.html @@ -13907,7 +13907,7 @@

      Runtime Semantics: KeyedDestructuringAssignmentEvaluation

      1. Let _rhsValue_ be ? GetValue(_defaultValue_). 1. Else, let _rhsValue_ be _v_. 1. If |DestructuringAssignmentTarget| is an |ObjectLiteral| or an |ArrayLiteral|, then - 1. Let _assignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |DestructuringAssignmentTarget|. + 1. Let _assignmentPattern_ be the parse of the source text corresponding to |DestructuringAssignmentTarget| using |AssignmentPattern| as the goal symbol with its [Yield] and [Await] parameters set to the values used when parsing this |DestructuringAssignmentTarget|. 1. Return the result of performing DestructuringAssignmentEvaluation of _assignmentPattern_ with _rhsValue_ as the argument. 1. If |Initializer| is present and _v_ is *undefined* and IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then 1. Let _hasNameProperty_ be ? HasOwnProperty(_rhsValue_, `"name"`). @@ -19382,7 +19382,7 @@

      Runtime Semantics: PropertyDefinitionEvaluation

      1. Perform ! MakeMethod(_closure_, _object_). 1. Perform ! SetFunctionName(_closure_, _propKey_). 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncMethod|. - 1. Let _desc_ be the Property Descriptor{[[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true*}. + 1. Let _desc_ be the PropertyDescriptor{[[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true*}. 1. Return ? DefinePropertyOrThrow(_object_, _propKey_, _desc_). From fe56d863778813afd629962b10ec39d221ecd09c Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Sat, 17 Sep 2016 18:37:30 -0400 Subject: [PATCH 39/42] Delete a couple more spaces from algorithm steps. (Hoping that space-before-"_name_" is no longer a problem.) --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 7e32d96337..bcab0824a8 100644 --- a/spec.html +++ b/spec.html @@ -19422,11 +19422,11 @@

      Runtime Semantics: Evaluation

      1. Let _funcEnv_ be ! NewDeclarativeEnvironment(_scope_). 1. Let _envRec_ be _funcEnv_'s EnvironmentRecord. 1. Let _name_ be StringValue of |BindingIdentifier|. - 1. Perform ! _envRec_.CreateImmutableBinding( _name_). + 1. Perform ! _envRec_.CreateImmutableBinding(_name_). 1. Let _closure_ be ! AsyncFunctionCreate(~Normal~, |FormalParameters|, |AsyncFunctionBody|, _funcEnv_, _strict_). 1. Set _closure_.[[SourceText]] to the source text matched by |AsyncFunctionExpression|. 1. Perform ! SetFunctionName(_closure_, _name_). - 1. Perform ! _envRec_.InitializeBinding( _name_, _closure_). + 1. Perform ! _envRec_.InitializeBinding(_name_, _closure_). 1. Return _closure_. From b059c4fb4c5b7f93b17ef281a613cd3db5b622ba Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Wed, 9 Nov 2016 15:25:40 -0800 Subject: [PATCH 40/42] Editorial: describe [[AsyncContext]] slot --- spec.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index bcab0824a8..0ff9a49897 100644 --- a/spec.html +++ b/spec.html @@ -35642,8 +35642,7 @@

      AsyncFunction.prototype [ @@toStringTag ]

      AsyncFunction Instances

      -

      Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in Table 27. The value of the [[FunctionKind]] internal slot for all such instances is `"normal"`. AsyncFunction instances are not constructors and do not have a [[Construct]] internal slot. AsyncFunction instances do not have a prototype property as they are not constructable.

      - +

      Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in . The value of the [[FunctionKind]] internal slot for all such instances is `"normal"`. AsyncFunction instances are not constructors and do not have a [[Construct]] internal slot. AsyncFunction instances do not have a prototype property as they are not constructable.

      Each AsyncFunction instance has the following own properties:

      length

      @@ -35720,7 +35719,7 @@

      AsyncFunctionAwait ( _value_ )

      AsyncFunction Awaited Fulfilled

      -

      Function _F_ is called with the parameter _value_.

      +

      Function _F_ is called with the parameter _value_. _F_ has an internal slot named [[AsyncContext]] which is the execution context that will be restored when _F_ is called.

      1. Let _asyncContext_ be _F_.[[AsyncContext]]. 1. Let _prevContext_ be the running execution context. @@ -35734,7 +35733,7 @@

      AsyncFunction Awaited Fulfilled

      AsyncFunction Awaited Rejected

      -

      Function _F_ is called with the parameter _reason_.

      +

      Function _F_ is called with the parameter _reason_. _F_ has an internal slot named [[AsyncContext]] which is the execution context that will be restored when _F_ is called.

      1. Let _asyncContext_ be _F_.[[AsyncContext]]. 1. Let _prevContext_ be the running execution context. From 14886ee68d04ae38be22963913bb455524b4fa9a Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Thu, 10 Nov 2016 13:06:06 -0800 Subject: [PATCH 41/42] Normative: Set throwawayPromiseCapability promise's PromiseIsHandled to true in AsyncFunctionAwait --- spec.html | 1 + 1 file changed, 1 insertion(+) diff --git a/spec.html b/spec.html index 0ff9a49897..dc68208254 100644 --- a/spec.html +++ b/spec.html @@ -35707,6 +35707,7 @@

      AsyncFunctionAwait ( _value_ )

      1. Set _onFulfilled_.[[AsyncContext]] to _asyncContext_. 1. Set _onRejected_.[[AsyncContext]] to _asyncContext_. 1. Let _throwawayCapability_ be NewPromiseCapability(%Promise%). + 1. Set _throwawayCapability_.[[Promise]].[[PromiseIsHandled]] to *true*. 1. Perform ! PerformPromiseThen(_promiseCapability_.[[Promise]], _onFulfilled_, _onRejected_, _throwawayCapability_). 1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed with a Completion _resumptionValue_ the following steps will be performed: From 261aaf89c3d83f31ea602a34e7e2c75c30866789 Mon Sep 17 00:00:00 2001 From: Brian Terlson Date: Fri, 11 Nov 2016 14:18:03 -0800 Subject: [PATCH 42/42] Editorial: mention async function constructor in sec-function-constructor --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index dc68208254..a65dad7e5d 100644 --- a/spec.html +++ b/spec.html @@ -23631,7 +23631,7 @@

      Function Objects

      The Function Constructor

      The Function constructor is the %Function% intrinsic object and the initial value of the `Function` property of the global object. When `Function` is called as a function rather than as a constructor, it creates and initializes a new Function object. Thus the function call `Function(…)` is equivalent to the object creation expression `new Function(…)` with the same arguments.

      -

      The `Function` constructor is designed to be subclassable. It may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `Function` behaviour must include a `super` call to the `Function` constructor to create and initialize a subclass instances with the internal slots necessary for built-in function behaviour. All ECMAScript syntactic forms for defining function objects create instances of `Function`. There is no syntactic means to create instances of `Function` subclasses except for the built-in `GeneratorFunction` subclass.

      +

      The `Function` constructor is designed to be subclassable. It may be used as the value of an `extends` clause of a class definition. Subclass constructors that intend to inherit the specified `Function` behaviour must include a `super` call to the `Function` constructor to create and initialize a subclass instances with the internal slots necessary for built-in function behaviour. All ECMAScript syntactic forms for defining function objects create instances of `Function`. There is no syntactic means to create instances of `Function` subclasses except for the built-in `GeneratorFunction` and `AsyncFunction` subclasses.