From 7dab9506c5c43d241842bc1b841de6b3d58992fb Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Mon, 25 Jan 2021 12:00:43 -0800 Subject: [PATCH] Editorial: Merge the RHSs of AsyncFunctionExpression (#2275) 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. --- spec.html | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/spec.html b/spec.html index 3bbbff5020..719db1d437 100644 --- a/spec.html +++ b/spec.html @@ -7587,8 +7587,7 @@

Static Semantics: IsFunctionDefinition

`async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}` AsyncFunctionExpression : - `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}` ClassExpression : `class` BindingIdentifier? ClassTail @@ -7746,8 +7745,7 @@

Static Semantics: Contains

`async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` AsyncFunctionExpression : - `async` `function` `(` FormalParameters `)` `{` AsyncFunctionBody `}` - `async` `function` BindingIdentifier `(` FormalParameters `)` `{` AsyncFunctionBody `}` + `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncFunctionBody `}` 1. Return *false*. @@ -20839,8 +20837,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` 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 `}` @@ -20886,8 +20883,7 @@

Static Semantics: Early Errors

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