static-gen-method-param-dflt-yield.js (824B)
1 // |reftest| error:SyntaxError 2 // Copyright (C) 2016 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-generator-function-definitions 6 es6id: 14.4 7 description: > 8 YieldExpression cannot be used within the FormalParameters of a generator 9 function 10 info: | 11 GeneratorMethod[Yield]: 12 13 * PropertyName[?Yield] ( StrictFormalParameters[Yield] ) { GeneratorBody } 14 15 YieldExpression cannot be used within the FormalParameters of a generator 16 function because any expressions that are part of FormalParameters are 17 evaluated before the resulting generator object is in a resumable state. 18 features: [generators, default-parameters] 19 negative: 20 phase: parse 21 type: SyntaxError 22 ---*/ 23 24 $DONOTEVALUATE(); 25 26 0, class { 27 static *g(x = yield) {} 28 };