Bug 159615 - [ES6] Promise.{all,race} no longer use @@species
Summary: [ES6] Promise.{all,race} no longer use @@species
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-10 22:43 PDT by Yusuke Suzuki
Modified: 2016-07-11 00:27 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.53 KB, patch)
2016-07-10 22:51 PDT, Yusuke Suzuki
keith_miller: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2016-07-10 22:43:32 PDT
[ES6] Promise.{all,race} no longer use @@species
Comment 1 Yusuke Suzuki 2016-07-10 22:51:37 PDT
Created attachment 283300 [details]
Patch
Comment 2 Keith Miller 2016-07-10 23:02:52 PDT
Comment on attachment 283300 [details]
Patch

r=me. I'm curious what the reasoning behind dropping @@species support was.
Comment 3 Yusuke Suzuki 2016-07-11 00:09:57 PDT
(In reply to comment #2)
> Comment on attachment 283300 [details]
> Patch
> 
> r=me. I'm curious what the reasoning behind dropping @@species support was.

https://github.com/tc39/ecma262/issues/151
https://esdiscuss.org/topic/resolve-reject-on-promise-subclasses-and-species#content-1
https://esdiscuss.org/topic/subclassing-es6-objects-with-es5-syntax#content-50

> Overall consistency in the language. Except for the two offending Promise static methods, all uses of @@species in the ES2015 spec (15 uses) are for the following pattern: Starting from one instance, one constructs a derived object for that instance. (The effective lookup of the @@species property is factored in the SpiecesConstructor and ArraySpeciesCreate abstract operations.)
> 
> Also, in static methods like Promise.all and Promise.race, a constructor is explicitly provided by the user: simply use it. Compare with what is done for arrays:


Seems that Promise.{resolve,reject,all,race} static functions are a factory function while Array#map etc. is an instance method.
Comment 4 Yusuke Suzuki 2016-07-11 00:10:40 PDT
(In reply to comment #3)
In the above comment, this is the quoted part from the es-discuss :)

> > Overall consistency in the language. Except for the two offending Promise static methods, all uses of @@species in the ES2015 spec (15 uses) are for the following pattern: Starting from one instance, one constructs a derived object for that instance. (The effective lookup of the @@species property is factored in the SpiecesConstructor and ArraySpeciesCreate abstract operations.)
> > 
> > Also, in static methods like Promise.all and Promise.race, a constructor is explicitly provided by the user: simply use it. Compare with what is done for arrays:
Comment 5 Yusuke Suzuki 2016-07-11 00:27:21 PDT
Committed r203052: <http://trac.webkit.org/changeset/203052>