From 688d619bfe2f7ed93dcfe5f2e62c20d804bd5999 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 15 Jan 2015 19:29:27 +1100 Subject: [PATCH] add identifier check to class id inheritance --- lib/6to5/transformation/transformers/es6-classes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/6to5/transformation/transformers/es6-classes.js b/lib/6to5/transformation/transformers/es6-classes.js index 69d3a41205..04be814120 100644 --- a/lib/6to5/transformation/transformers/es6-classes.js +++ b/lib/6to5/transformation/transformers/es6-classes.js @@ -14,7 +14,8 @@ exports.ClassExpression = function (node, parent, file, scope) { node.id = parent.key; } - if (t.isVariableDeclarator(parent)) { + if (t.isVariableDeclarator(parent) && t.isIdentifier(parent.id)) { + // var foo = class {}; node.id = parent.id; } }