nested-private-arrow-fnc-init-err-contains-arguments.js (1137B)
1 // |reftest| error:SyntaxError 2 // This file was procedurally generated from the following sources: 3 // - src/class-elements/init-err-contains-arguments.case 4 // - src/class-elements/initializer-error/cls-decl-fields-private-arrow-fnc-nested.template 5 /*--- 6 description: Syntax error if `arguments` used in class field (private field, arrow function expression) 7 esid: sec-class-definitions-static-semantics-early-errors 8 features: [class, class-fields-public, arrow-function, class-fields-private] 9 flags: [generated] 10 negative: 11 phase: parse 12 type: SyntaxError 13 info: | 14 Static Semantics: Early Errors 15 16 FieldDefinition: 17 PropertyNameInitializeropt 18 19 - It is a Syntax Error if ContainsArguments of Initializer is true. 20 21 Static Semantics: ContainsArguments 22 IdentifierReference : Identifier 23 24 1. If the StringValue of Identifier is "arguments", return true. 25 ... 26 For all other grammatical productions, recurse on all nonterminals. If any piece returns true, then return true. Otherwise return false. 27 28 ---*/ 29 30 31 $DONOTEVALUATE(); 32 33 class C { 34 #x = () => { 35 var t = () => arguments; 36 t(); 37 } 38 }