private-field-invalid-assignment-reference.js (583B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2021 André Bargull. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 description: > 7 Private identifiers aren't valid simple assignment references. 8 info: | 9 Syntax 10 for ( LeftHandSideExpression in Expression ) Statement 11 esid: sec-for-in-and-for-of-statements-static-semantics-early-errors 12 negative: 13 phase: parse 14 type: SyntaxError 15 features: [class-fields-private, class-fields-private-in] 16 ---*/ 17 18 $DONOTEVALUATE(); 19 20 class C { 21 #field; 22 23 m() { 24 for (#field in []) ; 25 } 26 }