traits are now impossible in ES6 until ES7 since rev32?

Kevin Smith zenparsing at
Thu Feb 5 21:07:04 PST 2015

> Hopefully I’m wrong in that is illegal, but if it is, this
> is a devastating change, especially when traits are scheduled for ES7 or
> later.

Class constructors will now throw when called.

The changes to classes were fundamental but necessary to support
subclassing of builtins (and future extensions to classes).

For mixins, can you move the initialization logic into a method (or a
static method), instead of having it in the constructor?

    class M() {
        // methods
        static initialize(obj) { }

    function ctor() {

    // etc.

Is this a viable pattern for traits/mixins?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list