blob: ac774535c6c7f73a9f67dd9e5f0a1070eaec38b7 [file] [log] [blame]
function foo(a) {
return [...a];
}
noInline(foo);
let arr = [];
for (let i = 0; i < 10000; i++) {
if (i % 100 === 0)
arr.push([], i);
foo(arr);
}
let calledIterator = false;
Array.prototype[Symbol.iterator] = function iterator() {
calledIterator = true;
return {
next() {
return {done: true};
}
};
};
foo(arr);
if (!calledIterator)
throw new Error("Bad result");