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