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

async function add(x) {
    return await new Promise((resolve, reject) => {reject(x)});
}

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