blob: d1b441c1da90032c77db95b67926b4d56fbe8e7c [file] [log] [blame]
function generator() {
var i = 0;
return {
next: function() {
i++;
if (i >= 3) {
return {done: true};
} else {
return {
value: i,
done: false
};
}
}
};
}
function fn() {
var iterator = generator();
iterator.next();
iterator.next();
return iterator.next().done;
}
assertEqual(fn(), true);
test(fn);