title: Mixins for ES6 classes, transpiled with babel
body: <p>According to various sources (<a href="http://www.2ality.com/2013/07/defending-constructors.html" rel="nofollow noreferrer">2ality</a>, <a href="https://esdiscuss.org/topic/traits-mixins-for-class-syntax" rel="nofollow noreferrer">esdiscuss</a>) one should be able to add mixins to classes:</p>
  
  <p><strong>EDIT</strong> discovered that class methods are not enumerable so that cannot work. Edited the code below, but still no joy</p>
  
  <pre><code>class CartoonCharacter {
    constructor(author) {
      this.author = author;
    }
  
    drawnBy() {
      console.log("drawn by", this.author);
    }
  }
  
  // THIS CANNOT WORK
  // class methods are not enumerable
  // class Human {
  //  haveFun() {
  //    console.log("drinking beer");
  //  }
  // }
  
  let Human = Object.create({}, {
    haveFun:   {
      enumerable: true,
      value: function () {
        console.log("drinking beer");
      }
    }
  });
  
  class Simpson extends Object.assign(CartoonCharacter, Human) {
    constructor(author) {
      super(author);
    }
  }
  
  
  let homer = new Simpson("Matt Groening");
  homer.drawnBy();  // expected: drawn by Matt Groening
  homer.haveFun();  // expected: drinking beer
  </code></pre>
  
  <p>I get the "drawn by Matt Groening" but instead of the "drinking beer" I get an error</p>
  
  <pre><code>-&gt; Uncaught TypeError: E.haveFun is not a function
  </code></pre>
  
  <hr>