Bug 154862 - Promise.prototype.then should use Symbol.species to construct the return Promise
Summary: Promise.prototype.then should use Symbol.species to construct the return Promise
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: Keith Miller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-01 10:33 PST by Keith Miller
Modified: 2016-03-01 17:08 PST (History)
4 users (show)

See Also:


Attachments
Patch (3.95 KB, patch)
2016-03-01 10:50 PST, Keith Miller
sbarati: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Miller 2016-03-01 10:33:59 PST
Promise.prototype.then should use Symbol.species to construct the return Promise
Comment 1 Keith Miller 2016-03-01 10:50:13 PST
Created attachment 272575 [details]
Patch
Comment 2 Saam Barati 2016-03-01 16:58:20 PST
Comment on attachment 272575 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=272575&action=review

> Source/JavaScriptCore/builtins/PromisePrototype.js:46
> +        var constructor = constructor[@symbolSpecies];

Style: remove the "var" here.

> Source/JavaScriptCore/builtins/PromisePrototype.js:47
> +        if (constructor == null)

Is this "==" instead of "===" on purpose for null/undefined case?
Comment 3 Keith Miller 2016-03-01 17:02:12 PST
Comment on attachment 272575 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=272575&action=review

>> Source/JavaScriptCore/builtins/PromisePrototype.js:46
>> +        var constructor = constructor[@symbolSpecies];
> 
> Style: remove the "var" here.

fixed.

>> Source/JavaScriptCore/builtins/PromisePrototype.js:47
>> +        if (constructor == null)
> 
> Is this "==" instead of "===" on purpose for null/undefined case?

Yeah.
Comment 4 Keith Miller 2016-03-01 17:08:58 PST
Committed r197428: <http://trac.webkit.org/changeset/197428>