@@new

C. Scott Ananian ecmascript at cscott.net
Wed Jun 18 11:36:18 PDT 2014


On Wed, Jun 18, 2014 at 2:18 PM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> I had a syntactic restriction on `super` for two reasons, neither one
> related to the kind of invariant you're thinking of: (1) if the
> super() call isn't there, I wanted to call it implicitly, for
> convenience and correctness-by-default; and, (2) until you call the
> base class @@new, there is no `this` value. But the syntactic
> restriction isn't sufficient for purpose #2, and besides none of us
> like it, so I will try to find another way. :)

Just for the record, Java maintains a similar syntactic/semantic
invariant on the use of `super`, so it can certainly be made to work.
On the other hand, it's also entirely true that nobody likes it very
much in Java, although they live can live with it (and there are
workarounds, like making one of the arguments a call to a static
method to do important work before the superclass constructor is
invoked).
  --scott


More information about the es-discuss mailing list