I noted some open issues on "Classes with Trait Composition"

Brendan Eich brendan at mozilla.com
Wed May 18 18:29:01 PDT 2011


On May 18, 2011, at 5:57 PM, Bob Nystrom wrote:

> class Point {
>   public x = 0, y = 0;
> }
> 
> let p = new Point();
> p.x; // 0

This is pretty rare, in my experience. A hard case? If the constructor does set x and y from parameters, then you have double-initialization. If some properties are non-writable, you can't do this. YAGNI?

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110518/0443ff49/attachment-0001.html>


More information about the es-discuss mailing list