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