diff --git a/src/loose/expression.js b/src/loose/expression.js index 80aac911eb..96d4f3a818 100644 --- a/src/loose/expression.js +++ b/src/loose/expression.js @@ -399,9 +399,10 @@ lp.parsePropertyAccessor = function() { } lp.parseIdent = function() { + let name = this.tok.type === tt.name ? this.tok.value : this.tok.type.keyword + if (!name) return this.dummyIdent() let node = this.startNode() - node.name = this.tok.type === tt.name ? this.tok.value : this.tok.type.keyword - this.next() + node.name = name return this.finishNode(node, "Identifier") }