Don't set inType flag when parsing property names (#266)
* Don't set inType flag when parsing property names * Add inPropertyName type definition * Move inPropertyName check before this.curContext()
This commit is contained in:
committed by
Daniel Tschinder
parent
dd4c4ead2d
commit
3267e5f365
@@ -850,11 +850,14 @@ pp.parsePropertyName = function (prop) {
|
||||
prop.computed = true;
|
||||
prop.key = this.parseMaybeAssign();
|
||||
this.expect(tt.bracketR);
|
||||
return prop.key;
|
||||
} else {
|
||||
prop.computed = false;
|
||||
return prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true);
|
||||
const oldInPropertyName = this.state.inPropertyName;
|
||||
this.state.inPropertyName = true;
|
||||
prop.key = (this.match(tt.num) || this.match(tt.string)) ? this.parseExprAtom() : this.parseIdentifier(true);
|
||||
this.state.inPropertyName = oldInPropertyName;
|
||||
}
|
||||
return prop.key;
|
||||
};
|
||||
|
||||
// Initialize empty function node.
|
||||
|
||||
Reference in New Issue
Block a user