blob: 0243b99e863f25ab5a25b9589aaf38fa86ea2656 [file] [log] [blame]
function test() {
var garply = "generator";
class C {
* [garply] () {
yield 5; yield 6;
}
}
var iterator = new C().generator();
var item = iterator.next();
var passed = item.value === 5 && item.done === false;
item = iterator.next();
passed &= item.value === 6 && item.done === false;
item = iterator.next();
passed &= item.value === undefined && item.done === true;
return passed;
}
if (!test())
throw new Error("Test failed");