blob: afdf7bf8bf3f3baec78d797091cb2b4259d08d6e [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function test(object, name, value)
{
object[name] = value;
}
noInline(test);
var array = [ 0, 1, 2 ];
array.hello = 42;
array.world = 44;
for (var i = 0; i < 1e6; ++i) {
test(array, "hello", i);
shouldBe(array.hello, i);
test(array, "world", i);
shouldBe(array.world, i);
test(array, 0, i);
shouldBe(array[0], i);
}