new instantiation design alternatives

Kevin Smith zenparsing at gmail.com
Mon Sep 15 14:19:50 PDT 2014


>
>
>>
> Isn't the latter (since it specifies ": super(x)") actually identical to
>
>     constructor(x, y) {
>         this = new super();
>         this.y = y;
>     }
>
> IOW, isn't it "I am constructor only and will throw if {[Call]]ed)?


No.  The idea is that the "class create expression" is only called when the
constructor is "new"d.  It's purpose is to set up the "this" value when
[[Construct]] is called, exactly as @@create used to.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140915/5aa67dde/attachment.html>


More information about the es-discuss mailing list