Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/generators/yield-as-literal-property-name.js

raw
1 // Copyright (C) 2013 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 `yield` may be used as a literal property name in an object literal
7 within generator function bodies.
8 es6id: 12.1.1
9 features: [generators]
10 ---*/
11
12 var result;
13 var g = function*() {
14 ({ get yield() { return 1 } });
15 };
16
17 result = g().next();
18 assert.sameValue(result.value, undefined);
19 assert.sameValue(result.done, true);