summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug1655940-3.js
blob: a9d984dd68883b7b0b7eebda97a6a2838478b78f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var ToObject = getSelfHostedValue("ToObject");

function f(arr) {
    for (var i = 0; i < arr.length; i++) {
        var v = arr[i];
        try {
            var x = 1;
            ToObject({});
            x = 2;
            ToObject(v);
        } catch (e) {
            assertEq(x, 2);
        }
    }
}

var a = [];
for (var i = 0; i < 50; i++) {
    a.push({}, null);
}
f(a);