On Jun 9, 2015, at 7:30 AM, C. Scott Ananian wrote: > `Promise.resolve` doesn't use the species pattern any more: > https://esdiscuss.org/topic/fixing-promise-resolve > The rationale was that `resolve` is more like a constructor than a mutator. > > I don't have a strong opinion about `Promise.all`, but I think perhaps it > would be better if none of the static methods of `Promise` (Promise.all, > Promise.race, Promise.reject) used the species pattern, which is more > appropriate for instance methods (like `Promise.prototype.then`, where it is > a natural fit).
I generally agree. You invoke one of these methods on a specific Promise constructor, presumably with the intend that it is an instance to that constructor you expect to get back. For example, compare the likely intent of: WeakPromise.all(iterator) and Promise.all(iterator) It seems just like what we discussed for Promise.resolve Allen
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss