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

let called = false;

var thenable = {
    then: function(resolve) {
        called = true;
        resolve();
    }
};

function executor(resolve, reject) {
    resolve(thenable);
    throw new Error('ignored');
}

new Promise(executor)
.then(() => assert.sameValue(called, true))
.then($DONE, $DONE);