Debian Codegraph @

js/src/tests/test262/language/statements/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 FunctionDeclaration[Yield, Default] :
11 function BindingIdentifier[?Yield] ( 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 f(x = yield) {
21 paramValue = x;
22 }
23
24 f();
25 }
26
27 g().next();
28
29 assert.sameValue(paramValue, 23);
30
31 reportCompare(0, 0);