From 9621d1bbeb8932290654e1d94cd4077739caa771 Mon Sep 17 00:00:00 2001 From: neVERberleRfellerER Date: Mon, 23 Feb 2015 17:39:42 +0100 Subject: [PATCH] remove unnecessary derived class constructor name --- lib/babel/transformation/transformers/es6/classes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }