blob: 8bf8dd94df18eb92fd89b00c9927e70757ebef5e [file] [log] [blame]
function foo(array) {
var result = 0;
for (var i = 0; i < array.length; i += 2)
result += array[i] + array[i + 1];
return result;
}
noInline(foo);
var array = [1, 2, 3, 4];
for (var i = 0; i < 10000; ++i) {
var result = foo(array);
if (result != 10)
throw "Error: bad result in loop: " + result;
}
var array = [1, 2, 3];
var result = foo(array);
if ("" + result != "NaN")
throw "Error: bad result at end: " + result;