PerformPromiseAll

Axel Rauschmayer axel at rauschma.de
Tue Jun 9 10:46:08 UTC 2015


https://people.mozilla.org/~jorendorff/es6-draft.html#sec-performpromiseall <https://people.mozilla.org/~jorendorff/es6-draft.html#sec-performpromiseall>

I’m wondering: Is it OK that PerformPromiseAll invokes `resolve()` via `C.resolve()` (versus `this.resolve()`) with `C` determined via the species pattern?

Rationale: `resolve()` uses the species pattern, too (which is why `this.resolve()` works well). Therefore, the species pattern is used twice, which may lead to unexpected effects: You define the species of `this` to be X, but the species of X is Y. Then `Promise.all()` creates an array with instances of Y, not X.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150609/f05431ae/attachment.html>


More information about the es-discuss mailing list