aboutsummaryrefslogtreecommitdiff
path: root/test/js/async_inline.t.js
blob: a20b77105b6c8414d979091ad34f0f4bf6a9d6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*---
includes: []
flags: [async]
---*/

function pr(x) {
    return new Promise(resolve => {resolve(x)});
}

async function add() {
    const a = pr(20);
    const b = pr(50);
    return await a + await b;
}

add().then(v => {
    assert.sameValue(v, 70);
}).then($DONE, $DONE);