summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1532265.js
blob: 500b6e4a642a6868515475f60c9ea51c0c29ea35 (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; skip-if: !('oomTest' in this)

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 {}
    }
});