param-dflt-yield.js (819B)
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 GeneratorExpression : 12 13 function * BindingIdentifier[Yield]opt ( FormalParameters[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, function*(x = yield) {};