Skip to content

Commit

Permalink
Editorial: Merge the RHSs of AsyncFunctionExpression (#2275)
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 #692)
I can't see any reason for it to be not like the others.
  • Loading branch information
jmdyck authored and ljharb committed Jan 25, 2021
1 parent 6e633e6 commit 7dab950
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -7587,8 +7587,7 @@ <h1>Static Semantics: IsFunctionDefinition</h1>
`async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}`

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

ClassExpression : `class` BindingIdentifier? ClassTail
</emu-grammar>
Expand Down Expand Up @@ -7746,8 +7745,7 @@ <h1>Static Semantics: Contains</h1>
`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression :
`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<emu-alg>
1. Return *false*.
Expand Down Expand Up @@ -20839,8 +20837,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 @@ -20886,8 +20883,7 @@ <h1>Static Semantics: Early Errors</h1>
`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`

AsyncFunctionExpression :
`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<ul>
<li>It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.</li>
Expand Down Expand Up @@ -20993,8 +20989,7 @@ <h1>Runtime Semantics: Evaluation</h1>
</emu-alg>
<emu-grammar>
AsyncFunctionExpression :
`async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}`
`async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}`
</emu-grammar>
<emu-alg>
1. Return InstantiateAsyncFunctionExpression of |AsyncFunctionExpression|.
Expand Down

0 comments on commit 7dab950

Please sign in to comment.