Debian Codegraph @

js/src/tests/test262/language/expressions/function/param-dflt-yield-non-strict.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-function-definitions
5 es6id: 14.1
6 description: >
7 The `yield` token is interpreted as an IdentifierReference within a generator
8 and outside of strict mode
9 info: |
10 FunctionExpression :
11 function BindingIdentifieropt ( FormalParameters ) { FunctionBody }
12 features: [generators, default-parameters]
13 flags: [noStrict]
14 ---*/
15
16 var yield = 23;
17 var paramValue;
18
19 function *g() {
20 (function(x = yield) {
21 paramValue = x;
22 }());
23 }
24
25 g().next();
26
27 assert.sameValue(paramValue, 23);
28
29 reportCompare(0, 0);