mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
Issue #2089 - Optimize Promise.then and Promise.all/race with default resolving functions
Based-on: m-c 1401508,1412200,1473970/{1-4}
This commit is contained in:
parent
55eacd43a4
commit
9744b0c2bc
17 changed files with 906 additions and 142 deletions
|
|
@ -0,0 +1,18 @@
|
|||
// Don't assert when the promise in the resolving functions is wrapped in a CCW.
|
||||
|
||||
function newPromiseCapability(newTarget) {
|
||||
var resolve, reject, promise = Reflect.construct(Promise, [function(r1, r2) {
|
||||
resolve = r1;
|
||||
reject = r2;
|
||||
}], newTarget);
|
||||
return {promise, resolve, reject};
|
||||
}
|
||||
|
||||
var g = newGlobal();
|
||||
|
||||
var {promise, reject} = newPromiseCapability(g.Promise);
|
||||
|
||||
g.settlePromiseNow(promise);
|
||||
|
||||
// Don't assert when rejecting the promise.
|
||||
reject(0);
|
||||
Loading…
Add table
Add a link
Reference in a new issue