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