Axel Rauschmayer wrote:
We could certainly add a great many novelties to classes: use-before-definition
errors for instance variables, separate instance variables distinct from
properties, etc. etc.
protected as well as private names, another novelty.
TC39 prefers to avoid such innovations. This doesn't mean we won't in due course add
any such thing but we won't do it in a big bad "scenario-solving" rush for
classes.
That seems like the right call. If anything, I would like to have support for
classes that produce read-only instances and sealed instances (it’s still easy
to accidentally add properties to an object) – both of which are tricky if
subtyping is involved. I don’t see use-before-definition as too problematic,
but there might be factors that I’m not aware of.
There are: where is the super call and what barriers are required to
throw on use-before-init across the superclass initialization flow?
We can defer these by deferring guards and const instance properties,
and tried to do so. But IIRC at least Waldemar was not happy leaving
writable instance properties usable (with default value undefined)
before being initialized.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss