Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/object/method-definition/gen-yield-identifier-strict.js

raw
1 // This file was procedurally generated from the following sources:
2 // - src/generators/yield-identifier-strict.case
3 // - src/generators/default/obj-method.template
4 /*---
5 description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Generator method)
6 esid: prod-GeneratorMethod
7 features: [generators]
8 flags: [generated, onlyStrict]
9 negative:
10 phase: parse
11 type: SyntaxError
12 info: |
13 14.4 Generator Function Definitions
14
15 GeneratorMethod[Yield, Await]:
16 * PropertyName[?Yield, ?Await] ( UniqueFormalParameters[+Yield, ~Await] ) { GeneratorBody }
17
18 ---*/
19 throw "Test262: This statement should not be evaluated.";
20
21 var callCount = 0;
22
23 var gen = {
24 *method() {
25 callCount += 1;
26 (function() {
27 var yield;
28 throw new Test262Error();
29 }())
30 }
31 }.method;
32
33 var iter = gen();
34
35
36
37 assert.sameValue(callCount, 1);