new instantiation design alternatives

Kevin Smith zenparsing at gmail.com
Wed Sep 17 06:39:58 PDT 2014


>
>
>     constructor(x, y) {
>         if (new^)
>             this = new super(x);
>         else
>             super.constructor(x);
>         this.y = y;
>     }
>
> The point here is that the purpose of the constructor method is not only
> allocation, but also (and primarily) initialisation.
>

Yes - you are right.  And I think we can safely assume that users will
refuse to write such boilerplate.  I'll have to consider things for a bit
before replying to the larger point.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140917/d3fe4dd2/attachment.html>


More information about the es-discuss mailing list