blob: 7d77cf88ab602ce4d387b71dccfbf1daf20f8e2e [file] [log] [blame]
let count = 0;
function foo(array) {
for (let v of array)
throw new Error();
}
noInline(foo);
let otherGlobal = createGlobalObject();
let array = otherGlobal.Array();
array[Symbol.iterator]().__proto__.next = function () {
count++;
return { done: true };
}
array[0] = 1;
const iterCount = 1e5;
for (let i = 0; i < iterCount; ++i)
foo(array);
if (iterCount !== count)
throw new Error();