aboutsummaryrefslogtreecommitdiff
path: root/test/js/async_recursive_large.t.js
blob: 423e8d01ece6f9c31cf6684aa646d28e416b502c (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
/*---
includes: [compareArray.js]
flags: [async]
---*/

let stages = [];

async function f(v) {
    if (v == 1000) {
        return;
    }

    stages.push(`f>${v}`);

    await "X";

    await f(v + 1);

    stages.push(`f<${v}`);
}

f(0)
.then(v => {
    assert.sameValue(stages.length, 2000);
})
.then($DONE, $DONE);