add support for a string literal constructor name

This commit is contained in:
Sebastian McKenzie
2015-02-18 15:06:18 +11:00
parent 8f0ffc7302
commit eeff4ac9d1

View File

@@ -159,7 +159,7 @@ ClassTransformer.prototype.buildBody = function () {
}, true);
replaceSupers.replace();
if (node.key.name === "constructor") {
if ((!node.computed && t.isIdentifier(node.key, { name: "constructor" })) || t.isLiteral(node.key, { value: "constructor" })) {
this.pushConstructor(node);
} else {
this.pushMethod(node);