]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | function foo(p) { |
2 | var result = 0; | |
3 | var o = {valueOf: function() { result = 1; }}; | |
4 | var q = {f: p ? o : 42}; | |
5 | var tmp = q.f + 1; | |
6 | return result; | |
7 | } | |
8 | ||
9 | noInline(foo); | |
10 | ||
11 | for (var i = 0; i < 10000; ++i) { | |
12 | var result = foo(false); | |
13 | if (result !== 0) | |
14 | throw "Error: bad result: " + result; | |
15 | } | |
16 | ||
17 | var result = foo(true); | |
18 | if (result !== 1) | |
19 | throw "Error: bad result at end: " + result; | |
20 |