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