Finding a "safety syntax" for classes

Russell Leggett russell.leggett at gmail.com
Tue Mar 20 13:04:09 PDT 2012


On Tue, Mar 20, 2012 at 3:58 PM, Kevin Smith <khs4473 at gmail.com> wrote:

> Yeah - Java enforces this by making it an error if a call to super happens
>> after any other statement.
>>
>
> Yes - and "magically" interleaving instance field initializers in between
> the super call and the rest of the constructor body.  Taking this approach
> would make desugaring more complicated.  I'm not "voting" either way though.
>
>
I wasn't suggesting we do it the Java way, I was just pointing out that
Java does something along these lines as well. Personally, I think JS is a
little too freewheeling to have that kind of restriction. I say let the
chips fall. Super can be called wherever in the constructor. Something like
your syntax can be added later to make it easier to "do the right thing". I
would say that there should be no more restrictions than what Allen has
shown in his <| examples. I don't think he has mentioned any, so I wouldn't
have any either.

- Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120320/a373e716/attachment.html>


More information about the es-discuss mailing list