Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/generators/param-dflt-yield.js

raw
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-generator-function-definitions
5 es6id: 14.4
6 description: >
7 YieldExpression cannot be used within the FormalParameters of a generator
8 function
9 info: |
10 GeneratorExpression :
11
12 function * BindingIdentifier[Yield]opt ( FormalParameters[Yield] ) { GeneratorBody }
13
14 YieldExpression cannot be used within the FormalParameters of a generator
15 function because any expressions that are part of FormalParameters are
16 evaluated before the resulting generator object is in a resumable state.
17 features: [generators, default-parameters]
18 negative:
19 phase: parse
20 type: SyntaxError
21 ---*/
22
23 throw "Test262: This statement should not be evaluated.";
24
25 0, function*(x = yield) {};