unoverload Literal AST node

This commit is contained in:
Sebastian McKenzie
2015-09-01 04:49:16 +01:00
parent 4088d85e32
commit 446b297465
535 changed files with 3124 additions and 1005 deletions

View File

@@ -565,7 +565,7 @@ pp.parseClass = function (node, isStatement, optionalId) {
key = this.parsePropertyName(method);
}
if (!method.static && (key.type === "Identifier" && key.name === "constructor" ||
key.type === "Literal" && key.value === "constructor")) {
key.type === "StringLiteral" && key.value === "constructor")) {
if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class");
if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier");
if (isGenerator) this.raise(key.start, "Constructor can't be a generator");