Make the loose parser's parseIdent actually returns an identifier with a name

This commit is contained in:
Marijn Haverbeke 2015-03-20 17:36:47 +01:00
parent 0fee7a395e
commit 685b51e0ae

View File

@ -399,9 +399,10 @@ lp.parsePropertyAccessor = function() {
} }
lp.parseIdent = 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() let node = this.startNode()
node.name = this.tok.type === tt.name ? this.tok.value : this.tok.type.keyword node.name = name
this.next()
return this.finishNode(node, "Identifier") return this.finishNode(node, "Identifier")
} }