Skip to content

Commit

Permalink
Editorial: Merge the RHSs of AsyncFunctionExpression
Browse files Browse the repository at this point in the history
The nonterminals:
- FunctionExpression
- ClassExpression
- GeneratorExpression
- AsyncGeneratorExpression

are all defined with a single RHS involving an optional BindingIdentifier.

But AsyncFunctionExpression is defined with two RHSs,
one with a BindingIdentifier and one without.
(It's been that way since it was introduced in PR tc39#692.)
I can't see any reason for it to be not like the others.
  • Loading branch information
jmdyck committed Jan 14, 2021
1 parent 190d474 commit 7eccfd8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -21236,8 +21236,7 @@ <h2>Syntax</h2>
[+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` BindingIdentifier[~Yield, +Await]? `(` FormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}`

AsyncMethod[Yield, Await] :
`async` [no LineTerminator here] PropertyName[?Yield, ?Await] `(` UniqueFormalParameters[~Yield, +Await] `)` `{` AsyncFunctionBody `}`
Expand Down Expand Up @@ -21282,9 +21281,7 @@ <h1>Static Semantics: Early Errors</h1>

AsyncFunctionDeclaration : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression : `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression : `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<ul>
<li>It is a Syntax Error if ContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
Expand Down Expand Up @@ -21335,9 +21332,7 @@ <h1>Static Semantics: Contains</h1>

AsyncFunctionDeclaration : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression : `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression : `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<emu-alg>
1. Return *false*.
Expand Down Expand Up @@ -21389,9 +21384,7 @@ <h1>Static Semantics: IsConstantDeclaration</h1>
<emu-clause id="sec-async-function-definitions-static-semantics-IsFunctionDefinition">
<h1>Static Semantics: IsFunctionDefinition</h1>
<emu-grammar>
AsyncFunctionExpression : `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression : `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
AsyncFunctionExpression : `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<emu-alg>
1. Return *true*.
Expand Down

0 comments on commit 7eccfd8

Please sign in to comment.