static-init-invalid-yield.js (566B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2021 the V8 project authors. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: sec-class-definitions 6 description: The "Yield" parsing context does not apply to the block's statement list 7 info: | 8 Syntax 9 10 [...] 11 12 ClassStaticBlockStatementList : 13 StatementList[~Yield, +Await, ~Return]opt 14 negative: 15 phase: parse 16 type: SyntaxError 17 features: [class-static-block] 18 ---*/ 19 20 $DONOTEVALUATE(); 21 22 function * g() { 23 class C { 24 static { 25 yield; 26 } 27 } 28 }