]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(a, b) { |
2 | var x = b.f; | |
3 | x += a[0]; | |
4 | return x + b.f; | |
5 | } | |
6 | ||
7 | noInline(foo); | |
8 | ||
9 | function test(a, b, c) { | |
10 | var result = foo(a, b); | |
11 | if (result != c) | |
12 | throw new Error("bad result: expected " + c + " but got: " + result); | |
13 | } | |
14 | ||
15 | var p = {f:42}; | |
16 | p[0] = 5; | |
17 | for (var i = 0; i < 100000; ++i) { | |
18 | test([4], p, 88); | |
19 | test([4.5], p, 88.5); | |
20 | } | |
21 | ||
22 | test(p, p, 89); |