Commit ee1671b9 authored by caitpotter88's avatar caitpotter88 Committed by Commit bot

[promise] use PromiseCapabilities directly for Promise.race resolve/reject

Does not remove the extra private state added, as doing so seems to break the
debugger.

Fixes new Test262 tests:
- built-ins/Promise/race/same-resolve-function
- built-ins/Promise/race/same-reject-function

BUG=v8:4632
LOG=N
R=littledan@chromium.org, cbruni@chromium.org

Review URL: https://codereview.chromium.org/1538853002

Cr-Commit-Position: refs/heads/master@{#33214}
parent 391517ea
......@@ -394,9 +394,8 @@ function PromiseRace(iterable) {
var deferred = NewPromiseCapability(this);
try {
for (var value of iterable) {
var reject = reason => { deferred.reject(reason); };
this.resolve(value).then((x) => { deferred.resolve(x) }, reject);
SET_PRIVATE(reject, promiseCombinedDeferredSymbol, deferred);
this.resolve(value).then(deferred.resolve, deferred.reject);
SET_PRIVATE(deferred.reject, promiseCombinedDeferredSymbol, deferred);
}
} catch (e) {
deferred.reject(e)
......
......@@ -403,10 +403,6 @@
'language/expressions/generators/invoke-as-constructor': [FAIL],
'language/expressions/object/method-definition/generator-invoke-ctor': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=4632
'built-ins/Promise/race/same-resolve-function': [FAIL],
'built-ins/Promise/race/same-reject-function': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=4633
'built-ins/Promise/reject-function-name': [FAIL],
'built-ins/Promise/resolve-function-name': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment