]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(p) { |
2 | if (p) { | |
3 | var x = 42; | |
4 | (function() { x = 43; })(); | |
5 | x++; | |
6 | var realResult = x; | |
7 | (function() { x = 44; })(); | |
8 | var fakeResult = x; | |
9 | return realResult; | |
10 | } | |
11 | var y = 45; | |
12 | (function() { y = 46; })(); | |
13 | y++; | |
14 | var realResult2 = y; | |
15 | (function() { y = 47; })(); | |
16 | var fakeResult2 = y; | |
17 | return realResult2; | |
18 | } | |
19 | ||
20 | noInline(foo); | |
21 | ||
22 | for (var i = 0; i < 10000; ++i) { | |
23 | var result = foo(i & 1); | |
24 | if (result != ((i & 1) ? 44 : 47)) | |
25 | throw "Error: bad result with i = " + i + ": " + result; | |
26 | } |