summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/promise/settle-now-breaks-all-invariants-9.js
blob: 45413d768c75fdebb4e4b16b6512abbe8037f689 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function newPromiseCapability() {
    var resolve, reject, promise = new Promise(function(r1, r2) {
        resolve = r1;
        reject = r2;
    });
    return {promise, resolve, reject};
}


var {promise, resolve, reject} = newPromiseCapability();

settlePromiseNow(promise);

assertEq(resolve(0), undefined);
assertEq(reject(0), undefined);