Domenic Denicola (2015-06-10T15:46:06.000Z)
Regardless of whether or not you agree, that was the original motivation for its introduction.

From: cananian at gmail.com [mailto:cananian at gmail.com] On Behalf Of C. Scott Ananian
Sent: Wednesday, June 10, 2015 11:45
To: Domenic Denicola
Cc: Allen Wirfs-Brock; Mark S. Miller; es-discuss list
Subject: Re: Fixing `Promise.resolve()`

I don't agree that @@species is useful at all for changing constructor signatures, since there is no closure argument.

If we had dynamically scoped variables, then:
```
  LabelledPromise[Symbol.species] = function() { return LabelledPromise.bind(label/*dynamically scoped*/); };
  function() {
    let label = "foo";
    return LabelledPromise.resolve(x);
  }
```
would indeed be very interesting.  But in the absence of some sort of closure, the only way you can make @@species into a custom constructor is for odd special cases where you are just rearranging deck chairs.

Why not:
 ```
class LabelledPromise {
  constructor(exec, label) {
    super(exec);
    this.label = label === undefined ? "<derived promise>" : label;
  }
}
```
  --scott

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150610/23e6bdea/attachment.html>
d at domenic.me (2015-06-16T16:45:31.826Z)
Regardless of whether or not you agree, that was the original motivation for its introduction.