await-as-identifier-reference.js (1072B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/async-functions/await-as-identifier-reference.case 4 // - src/async-functions/syntax/async-class-decl-static-private-method.template 5 /*--- 6 description: await is a reserved keyword within generator function bodies and may not be used as an identifier reference. (Static async private method as a ClassDeclaration element) 7 esid: prod-AsyncMethod 8 features: [async-functions, class-static-methods-private] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 ClassElement : 15 static PrivateMethodDefinition 16 17 MethodDefinition : 18 AsyncMethod 19 20 Async Function Definitions 21 22 AsyncMethod : 23 async [no LineTerminator here] # PropertyName ( UniqueFormalParameters ) { AsyncFunctionBody } 24 25 26 IdentifierReference : Identifier 27 28 It is a Syntax Error if this production has a [Await] parameter and 29 StringValue of Identifier is "await". 30 31 ---*/ 32 $DONOTEVALUATE(); 33 34 35 class C { 36 static async #method() { 37 void await; 38 } 39 }