WSL should have more tests of type checking failures
[WebKit-https.git] / JSTests / es6 / generators_computed_shorthand_generators_classes.js
1 function test() {
2
3 var garply = "generator";
4 class C {
5   * [garply] () {
6     yield 5; yield 6;
7   }
8 }
9 var iterator = new C().generator();
10 var item = iterator.next();
11 var passed = item.value === 5 && item.done === false;
12 item = iterator.next();
13 passed    &= item.value === 6 && item.done === false;
14 item = iterator.next();
15 passed    &= item.value === undefined && item.done === true;
16 return passed;
17       
18 }
19
20 if (!test())
21     throw new Error("Test failed");
22