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

var returnValue = null;
var resolve;

var promise = new Promise(function(_resolve) {
    resolve = _resolve;
});

promise
.then(
    v => $DONOTEVALUATE(),
    e => {

        assert.sameValue(e.constructor, TypeError,
                         'The promise should be rejected with a TypeError instance.');
})
.then($DONE, $DONE);

returnValue = resolve(promise);

assert.sameValue(returnValue, undefined);