summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1532265.js
blob: bf8416b78df5b5b6476b4b53f804eec26f1930df (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
33
// |jit-test| allow-oom

ignoreUnhandledRejections();

var v = {}
async function f() {
    // Increasing level of stack size during await to make OOM more likely when
    // saving the stack state.
              [await v];
             [[await v]];
            [[[await v]]];
           [[[[await v]]]];
          [[[[[await v]]]]];
         [[[[[[await v]]]]]];
        [[[[[[[await v]]]]]]];
       [[[[[[[[await v]]]]]]]];
      [[[[[[[[[await v]]]]]]]]];
     [[[[[[[[[[await v]]]]]]]]]];
}

oomTest(function() {
    for (var i = 0; i < 8; ++i) {
        f();
    }

    // Drain all jobs, ignoring any OOM errors.
    while (true) {
        try {
            drainJobQueue();
            break;
        } catch {}
    }
});