blob: 7dde5342d6dfd985f9b56d7c5a1d766246eced8b [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;
let arrayIterator = [][Symbol.iterator]().__proto__;
arrayIterator.next = function() {
calledIterator = true;
return {done: true};
};
let r = foo(arr);
if (!calledIterator || r.length)
throw new Error("Bad result");