summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/promise/resolve-promise-scripted-and-api.js
blob: d69a6d91677db0505ab3d360c01321df203b3bbc (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} = newPromiseCapability();

resolve(Promise.resolve(0));

// Don't assert when the Promise was already resolved.
resolvePromise(promise, 123);