blob: b99669d92df0c8f1e5781e1b2661922f03145d09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// |jit-test| skip-if: !('oomTest' in this)
function arrayProtoOutOfRange() {
function f(obj) {
return typeof obj[15];
}
function test() {
var a = [1, 2];
a.__proto__ = {15: 1337};
var b = [1, 2, 3, 4];
for (var i = 0; i < 200; i++) {
var r = f(i % 2 ? a : b);
assertEq(r, i % 2 ? "number" : "undefined");
}
}
test();
}
oomTest(arrayProtoOutOfRange);
|