blob: 5449872c634fdef30d7e8d3d59669b29cceabfca [file] [log] [blame]
function assert(b) {
if (!b)
throw new Error;
}
noInline(assert);
function foo(...args) {
return args[0];
}
noInline(foo);
for (let i = 0; i < 10000; i++) {
// Warm it up on both in bound and out of bound accesses.
if (i % 2)
assert(foo(i) === i);
else
assert(foo() === undefined);
}
let newProto = [50];
newProto.__proto__ = null;
Array.prototype.__proto__ = newProto;
for (let i = 0; i < 10000; i++)
assert(foo() === 50);