blob: aa61b815152833886839414bb84aaaf77293fb16 [file] [log] [blame]
function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
Array.prototype[42] = 0;
(function () {
function indexOf(array, value)
{
return array.indexOf(value);
}
noInline(indexOf);
var array = new Array(100);
array.push(10);
for (var i = 0; i < 1e5; ++i)
shouldBe(indexOf(array, 0), 42);
}());
(function () {
function indexOf(array, value)
{
return array.indexOf(value);
}
noInline(indexOf);
var array = new Array(100);
array.push(25.5);
for (var i = 0; i < 1e5; ++i)
shouldBe(indexOf(array, 0), 42);
}());