resolve()/reject() on Promise subclasses and @@species

C. Scott Ananian ecmascript at cscott.net
Thu Nov 19 20:31:21 UTC 2015


On Wed, Nov 18, 2015 at 6:50 PM, Domenic Denicola <d at domenic.me> wrote:

> All uses of @@species are to be removed from Promise.race and Promise.all.
> The committee achieved consensus on this, without you.
>

To be precise, steps 3-5 are to be removed entirely from Promise.all
(25.4.4.1) and Promise.race (25.4.4.3)?

So for `WeakPromise.all([ p1, {} ])` a weak reference would be held to p1's
value, the new {} object, *and* the array result of the `all`.
Similarly, `TimeoutPromise.all([ p1, p2 ])` would put timeouts on p1 and p2
*and* on the array result, so the semantics are the same as:
`TimeoutPromise.resolve(TimeoutPromise.all([ TimeoutPromise.resolve(p1),
TimeoutPromise.resolve(p2) ]))`.

I'm not objecting to this semantics, necessarily, I'm just surprised it
wasn't proposed or discussed on the public mailing list before adoption.
 --scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151119/29877514/attachment.html>


More information about the es-discuss mailing list