Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove @@species lookup from Promise.all() and Promise.race() #151

Closed
claudepache opened this issue Nov 3, 2015 · 6 comments
Closed

Remove @@species lookup from Promise.all() and Promise.race() #151

claudepache opened this issue Nov 3, 2015 · 6 comments

Comments

@claudepache
Copy link
Contributor

See https://esdiscuss.org/topic/resolve-reject-on-promise-subclasses-and-species

@zloirock
Copy link

zloirock commented Nov 3, 2015

@@species from Promise.resolve and Promise.reject was removed after this issue. Will be strange also remove it from Promise.all and Promise.race, but leave it in Promise#then / Promise#catch.

@claudepache
Copy link
Contributor Author

@zloirock It would be consistent with, e.g., Array.from, etc. (static method, explicit constructor, no @@species lookup) vs. Array#slice, etc. (instance method, implicit constructor, @@species lookup).

@zloirock
Copy link

zloirock commented Nov 3, 2015

@claudepache it will be consistent, but only for me this approach seems strange? For prototype methods - new this.constructor[@@species], for statics - instead of new this[@@species] just new this. In this case, it would be logical to store @@species on prototype.

@bterlson bterlson added the needs consensus This needs committee consensus before it can be eligible to be merged. label Nov 9, 2015
@bterlson
Copy link
Member

We are going to remove @@species from promise.all and promise.race. PR's accepted!

@bterlson bterlson removed the needs consensus This needs committee consensus before it can be eligible to be merged. label Nov 18, 2015
@cscott
Copy link

cscott commented Nov 18, 2015

Um, we need an exact spec. There are two different uses of species in promise.all/race, as I described in the thread above. I made a proposal for how the two uses should be resolved; are you adopting my wording?

@cscott
Copy link

cscott commented Nov 18, 2015

domenic added a commit that referenced this issue Nov 21, 2015
Fixes #151, per November 2015 TC39 meeting.
ljharb added a commit to paulmillr/es6-shim that referenced this issue Nov 29, 2015
anba added a commit to anba/test262 that referenced this issue Dec 2, 2015
- RegExp.prototype[Symbol.split] calls ToUint32 (tc39/ecma262#92)
- Species lookup removed from Promise.all and Promise.race (tc39/ecma262#151)
- Generator functions are no longer constructors (tc39/ecma262#171)

Fixes tc39#444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants