]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function foo(o) { |
2 | return o.f; | |
3 | } | |
4 | ||
5 | noInline(foo); | |
6 | ||
7 | var counter = 0; | |
8 | ||
9 | function test(o, expected, expectedCount) { | |
10 | var result = foo(o); | |
11 | if (result != expected) | |
12 | throw new Error("Bad result: " + result); | |
13 | if (counter != expectedCount) | |
14 | throw new Error("Bad counter value: " + counter); | |
15 | } | |
16 | ||
17 | for (var i = 0; i < 100000; ++i) { | |
18 | var o = {}; | |
19 | o.__defineGetter__("f", function() { | |
20 | counter++; | |
21 | return 84; | |
22 | }); | |
23 | test(o, 84, counter + 1); | |
24 | } |