>
> I think there's probably still wiggle room. Perhaps in the future, new()
> could be added with additional semantics...
>

This may be a possibility.  Presumably in such a future it would be a
static error to have both a "constructor" and a "new".



> Anyway, unless we are going to really make classes distinct from
> functions, I'm not sure how we could enforce super in the way you describe
> without affecting it in other forms. Can you only extend classes created
> using "class" syntax?
>

No - any function (constructor) can be to the right of "extends".  Again,
not necessarily arguing the case either way, but if in some future there
were field initializers then they would presumably be at the top of the
desugared constructor:

function _ctor(a, b, c) {
    // super constructor call?
    // execute field initializers
    // "new" / "constructor" body
}

kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to