blob: 03bcfd7eedc399e0515982b934adda0d903b2df9 [file] [log] [blame]
function foo() { return arguments.length; }
var o = {};
o[0] = 42;
var callCount = 0;
o.__defineGetter__("length", function() {
callCount++;
return 1;
});
function bar() {
callCount = 0;
var result = foo.apply(this, o);
if (result != 1)
throw "Error: bad result: " + result;
if (callCount != 1)
throw "Error: bad call count: " + callCount;
}
noInline(foo);
noInline(bar);
for (var i = 0; i < 10000; ++i)
bar();