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

2015-11-19 Thread C. Scott Ananian
On Wed, Nov 18, 2015 at 6:50 PM, Domenic Denicola 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.

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

2015-11-18 Thread Domenic Denicola
@mozilla.org list Subject: Re: resolve()/reject() on Promise subclasses and @@species Unfortunately, it's not just a specification device, it has a real effect on the behavior of Promise subclasses. In the case of TimeoutPromise, for instance, it affects whether the timeouts apply to *each promi

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

2015-11-18 Thread C. Scott Ananian
Unfortunately, it's not just a specification device, it has a real effect on the behavior of Promise subclasses. In the case of TimeoutPromise, for instance, it affects whether the timeouts apply to *each promise in the array* or just to the final result Promise. I'm hearing through the grapevine

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

2015-11-04 Thread Boris Zbarsky
On 11/4/15 11:22 PM, C. Scott Ananian wrote: see my previous message for the exact wording proposal which changes step 6. https://esdiscuss.org/topic/performpromiseall#content-6 you mean? I don't have a strong opinion on it, honestly. The existence of the intermediate promises in all/race se

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

2015-11-04 Thread C. Scott Ananian
The spec has been implemented as is by both `es6-shim` and `core-js`, and there are plenty of users of these. So it's not correct to say that it hasn't been implemented yet; folks aren't waiting for the browsers. The differing behaviors in the null-or-undefined case should probably be remedied, a

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

2015-11-04 Thread Boris Zbarsky
On 11/4/15 10:29 PM, C. Scott Ananian wrote: Again, the reasoning at the time was that `Promise.all(x)` could be considered sugar for `Promise.resolve(x).all()` in ES7, and so `Promise.all` was "really" an instance method after all. OK, but note that the behavior of the two is different (or at

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

2015-11-04 Thread C. Scott Ananian
Again, the reasoning at the time was that `Promise.all(x)` could be considered sugar for `Promise.resolve(x).all()` in ES7, and so `Promise.all` was "really" an instance method after all. Again, I could support a change, I'm just saying it wasn't totally crazy, and no one made any objection at the

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

2015-11-04 Thread Boris Zbarsky
On 11/4/15 9:36 PM, Domenic Denicola wrote: But it seems that ES15 decided to only use @@species for instance methods Except it also uses it for Promise.all and Promise.race. -Boris ___ es-discuss mailing list es-discuss@mozilla.org https://mail.moz

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

2015-11-04 Thread C. Scott Ananian
(Sorry, that should have been `Promise.resolve`, not `Promise#resolve`.) --scott ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2015-11-04 Thread C. Scott Ananian
Without rehashing the previous discussion, I totally disagree. Having `Promise#resolve()` go through `@@species` made it totally useless. It's also not in the spirit of the smalltalk species, which used very narrowly for instance methods like `map`, not for constructors. --scott ___

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

2015-11-04 Thread Domenic Denicola
27;s where we're stuck. From: "C. Scott Ananian" Sent: Nov 5, 2015 3:20 AM To: Allen Wirfs-Brock Cc: es-discuss Subject: Re: resolve()/reject() on Promise subclasses and @@species As referenced in the cited thread (https://esdiscuss.org/topic/performpromiseall#content-6) there

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

2015-11-04 Thread C. Scott Ananian
As referenced in the cited thread (https://esdiscuss.org/topic/performpromiseall#content-6) there are actually two uses of the Promise constructor in the definition of `all` and `race`. To quote myself: > [N]ote that the implementations given for `Promise.all` and `Promise.race` > use Promises i

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

2015-10-30 Thread Allen Wirfs-Brock
+1 Allen > On Oct 30, 2015, at 10:19 AM, Claude Pache > wrote: > > >> Le 29 oct. 2015 à 03:51, Boris Zbarsky > > a écrit : >> >> I was just implementing subclassing of Promise in Gecko, when I realized >> that given a Promise subclass M

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

2015-10-30 Thread Boris Zbarsky
On 10/30/15 1:19 PM, Claude Pache wrote: Should it be corrected before @@species is widely implemented? Or implemented at all? Chrome doesn't implement it yet. My Firefox tree does for Promise as of today, but I could just as easily drop it from all/race if people prefer that. -Boris

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

2015-10-30 Thread Kevin Smith
> > Should it be corrected before @@species is widely implemented? I think so. > I agree, if feasible. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

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

2015-10-30 Thread Claude Pache
> Le 29 oct. 2015 à 03:51, Boris Zbarsky a écrit : > > I was just implementing subclassing of Promise in Gecko, when I realized that > given a Promise subclass MyPromise these two calls: > > MyPromise.race([]) > MyPromise.all([]) > > will take MyPromise[@@species] into account when creating

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

2015-10-28 Thread Boris Zbarsky
I was just implementing subclassing of Promise in Gecko, when I realized that given a Promise subclass MyPromise these two calls: MyPromise.race([]) MyPromise.all([]) will take MyPromise[@@species] into account when creating the return value, but these two calls: MyPromise.resolve()