From 7eccfd8848c81936bd19118241908d6994f0dffc Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 13 Jan 2021 20:15:15 -0500 Subject: [PATCH] Editorial: Merge the RHSs of AsyncFunctionExpression 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, 4 insertions(+), 11 deletions(-) diff --git a/spec.html b/spec.html index c528a236a4c..9303c53d11c 100644 --- a/spec.html +++ b/spec.html @@ -21236,8 +21236,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 `}` @@ -21282,9 +21281,7 @@

Static Semantics: Early Errors

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