]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(a, i) { |
2 | return a[i]; | |
3 | } | |
4 | ||
5 | noInline(foo); | |
6 | ||
7 | function test(value) { | |
8 | var result = foo([value], 0); | |
9 | if (result != value) | |
10 | throw "Error: bad result: " + result; | |
11 | } | |
12 | ||
13 | for (var i = 0; i < 100000; ++i) | |
14 | test(42); | |
15 | ||
16 | var result = foo([42], 1); | |
17 | if (result !== void 0) | |
18 | throw "Error: bad result: " + result; | |
19 | ||
20 | result = foo([42], 100); | |
21 | if (result !== void 0) | |
22 | throw "Error: bad result: " + result; | |
23 | ||
24 | result = foo([42], 10000); | |
25 | if (result !== void 0) | |
26 | throw "Error: bad result: " + result; | |
27 | ||
28 | Array.prototype[10000] = 23; | |
29 | result = foo([42], 10000); | |
30 | if (result !== 23) | |
31 | throw "Error: bad result: " + result; |