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