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