haikuwebkit/JSTests/stress/operation-in-may-have-negat...

19 lines
284 B
JavaScript

function shouldBe(actual, expected)
{
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
var k = -1;
var o1 = [42.5];
o1[k] = 300.2;
function test1(o)
{
return k in o;
}
noInline(test1);
for (var i = 0; i < 1e6; ++i)
shouldBe(test1(o1), true);