diff --git a/lib/babel/transformation/transformers/es6/classes.js b/lib/babel/transformation/transformers/es6/classes.js index 20df75660c..8ca8786924 100644 --- a/lib/babel/transformation/transformers/es6/classes.js +++ b/lib/babel/transformation/transformers/es6/classes.js @@ -84,9 +84,9 @@ ClassTransformer.prototype.run = function () { body.push(constructor); } else { var constructorName = null; - // when there is only constructor or nothing, constructor is not - // wrapped in closure and has to be named - if (this.node.body.body.length <= 1) { + // when class has no parent and there is only constructor or nothing then + // constructor is not wrapped in closure and has to be named + if (!this.hasSuper && this.node.body.body.length <= 1) { constructorName = className; }