]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function foo() { return arguments.length; } |
2 | ||
3 | var o = {}; | |
4 | o[0] = 42; | |
5 | var callCount = 0; | |
6 | o.__defineGetter__("length", function() { | |
7 | callCount++; | |
8 | return 1; | |
9 | }); | |
10 | ||
11 | function bar() { | |
12 | callCount = 0; | |
13 | var result = foo.apply(this, o); | |
14 | if (result != 1) | |
15 | throw "Error: bad result: " + result; | |
16 | if (callCount != 1) | |
17 | throw "Error: bad call count: " + callCount; | |
18 | } | |
19 | ||
20 | noInline(foo); | |
21 | noInline(bar); | |
22 | ||
23 | for (var i = 0; i < 10000; ++i) | |
24 | bar(); |