Closed raulsebastianmihaila closed 5 years ago
What makes you say so?
For context, the current PerformPromiseAny
spec matches PerformPromiseAll
:
Perform ? Invoke(nextPromise, "then", « resolveElement, resultCapability.[[Reject]] »).
PerformPromiseRace
does something else:
Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], resultCapability.[[Reject]] »).
PerformPromiseAllSettled
does:
Perform ? Invoke(nextPromise, "then", « resolveElement, rejectElement »).
Are we looking in the same place? See 8.r.: https://tc39.es/proposal-promise-any/#sec-performpromiseany
Yes? It says:
Perform ? Invoke(nextPromise, "then", « resultCapability, rejectElement[[Reject]] »).
...which I pointed out matches PerformPromiseAll
. I'm probably missing something here -- could you please elaborate on why you'd go with a different approach?
I don't think it matches PerformPromiseAll
. PerformPromiseAll
does, as you pointed out:
Perform ? Invoke(nextPromise, "then", « resolveElement, resultCapability.[[Reject]] »).
Compare that to:
Perform ? Invoke(nextPromise, "then", « resultCapability, rejectElement[[Reject]] »).
As you can see, PerformPromiseAll
calls then
with a resolveElement
, which is a function, and with a resultCapability.[[Reject]]
, which is also a function. PerformPromiseAny
calls then
with a promise capability record, which is not a function, and with rejectElement[[Reject]]
which is incorrect even syntactically. Syntactically it should be rejectElement.[[Reject]]
, but then it would be semantically incorrect, because rejectElement
is a function, not a record.
Thanks for clarifying that. Would you mind submitting a PR to fix this?
Addressed by #26.
During a quick read I saw line 8.r. of PerformPromiseAny:
Shouldn't that be?: