title: Extended Errors do not have message or stack trace
body: <p>When running this snippet through BabelJS:</p>
  
  <pre><code>class FooError extends Error {
    constructor(message) {
      super(message);
    }
  }
  
  let error = new FooError('foo');
  console.log(error, error.message, error.stack);
  </code></pre>
  
  <p>it outputs</p>
  
  <pre><code>{}
  </code></pre>
  
  <p>which is not what I expect. Running</p>
  
  <pre><code>error = new Error('foo');
  console.log(error, error.message, error.stack);
  </code></pre>
  
  <p>produces</p>
  
  <pre><code>{} foo Error: foo
      at eval (eval at &lt;anonymous&gt; (https://babeljs.io/scripts/repl.js?t=2015-05-21T16:46:33+00:00:263:11), &lt;anonymous&gt;:24:9)
      at REPL.evaluate (https://babeljs.io/scripts/repl.js?t=2015-05-21T16:46:33+00:00:263:36)
      at REPL.compile (https://babeljs.io/scripts/repl.js?t=2015-05-21T16:46:33+00:00:210:12)
      at Array.onSourceChange (https://babeljs.io/scripts/repl.js?t=2015-05-21T16:46:33+00:00:288:12)
      at u (https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js:28:185)
  </code></pre>
  
  <p>which is exactly what I would like from the extended error.</p>
  
  <p>My goal is to extend <code>Error</code> into a variety of subclasses and use them in bluebird's <code>catch</code> matching. So far, that is failing miserably.</p>
  
  <p>Why is the subclass not showing a message or stack trace?</p>
  
  <p><strong>Edit:</strong> <a href="https://jsfiddle.net/5e3kakqj/" rel="nofollow">using Chrome's built-in subclassing</a> (thanks to @coder) works perfectly. This isn't specific to Babel, necessarily, as the following example (from <a href="https://gitter.im/babel/babel?at=555f678f727234850fc7656d" rel="nofollow">@loganfsmyth on Babel's gitter feed</a>) shows:</p>
  
  <pre><code>// Works
  new (function(){
    "use strict";
    return class E extends Error { }
  }());
  // Doesn't
  new (function(){
    "use strict";
    function E(message){
      Error.call(this, message);
    };
    E.prototype = Object.create(Error);
    E.prototype.constructor = E;
    return E;
  }());
  </code></pre>