summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1185653.js
blob: b29fd6e0cd2d883e211c4fb7c580b7b9bad85cb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function f() {
    var arr = [];
    for (var i=0; i<80; i++) {
        var o3 = {foo: i};
        var o2 = {owner: o3};
        arr.push(o2);
    }
    for (var i=0; i<80; i++) {
        var o2 = arr[i];
        var o3 = o2.owner;
        Object.defineProperty(o3, "bar", {value: arr, enumerable: false});
    }
    assertEq(JSON.stringify(arr).length, 1671);
}
f();

function g() {
    var arr = [];
    for (var i=0; i<100; i++) {
        arr.push([1, i]);
    }
    for (var i=0; i<100; i++) {
        for (var p in arr[i]) {
            assertEq(p === "0" || p === "1", true);
        }
    }
}
g();