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
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss