]>
Commit | Line | Data |
---|---|---|
ed1e77d3 A |
1 | (function() { |
2 | // Change string value of the loop variable in the loop. | |
3 | var foo = function() { | |
4 | var sum = 0; | |
5 | var a = [1, 2, 3]; | |
6 | a.foo = 42; | |
7 | for (var i in a) { | |
8 | i = "foo"; | |
9 | sum += a[i]; | |
10 | } | |
11 | return sum; | |
12 | }; | |
13 | noInline(foo); | |
14 | for (var i = 0; i < 10000; ++i) { | |
15 | if (foo() != 42 * 4) | |
16 | throw new Error("bad result"); | |
17 | } | |
18 | foo(null); | |
19 | })(); |