blob: 1f617a285f9e193844e261326fc35aed6e30ba3b [file] [log] [blame]
function Cons() {
}
Cons.prototype.__defineGetter__("f", function() {
counter++;
return 84;
});
function foo(o) {
return o.f;
}
noInline(foo);
var counter = 0;
function test(o, expected, expectedCount) {
var result = foo(o);
if (result != expected)
throw new Error("Bad result: " + result);
if (counter != expectedCount)
throw new Error("Bad counter value: " + counter);
}
for (var i = 0; i < 100000; ++i) {
test(new Cons(), 84, counter + 1);
var o = new Cons();
o.g = 54;
test(o, 84, counter + 1);
}