summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/bug1782562-toSource-veclen.js
blob: bb2c8d665f68a80e673a6cf5d0369682d076792d (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
29
30
31
32
// |jit-test| skip-if: getBuildConfiguration("android")

try {
    var z = "1";
    try {
        f = function (x) {
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
            (function(){});
        };
        for (let i = 0; i < 99; i++)
            z += z
    } catch (e) {}
    uneval(this);
    assertEq(getBuildConfiguration("pointer-byte-size"), 8, "32-bit should OOM; 64-bit should not");
} catch (e) {
    const msg = e + "";
    assertEq(msg.includes("out of memory") || msg.includes("InternalError: allocation size overflow"), true);
}