blob: 78649b77124358ecd92bb4263360986436ab7d6f [file] [log] [blame]
function test() {
class C {
* generator() {
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");