blob: 61537610c2f01dd63e469c3b0cb59b4c06f1b5a7 [file] [log] [blame]
function test() {
function * generator(){
yield 5; yield 6;
};
var iterator = 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");