blob: 11986f000415ced5b89aae5d82c74dd33a16d243 [file] [log] [blame]
function test() {
var iterator = (function * generator() {
yield * (function*(){ yield 5; yield 6; yield 7; }());
}());
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 === 7 && item.done === false;
item = iterator.next();
passed &= item.value === undefined && item.done === true;
return passed;
}
if (!test())
throw new Error("Test failed");