Ensure non pattern shorthand props are checked for reserved words (#479)
This commit is contained in:
committed by
Daniel Tschinder
parent
d975b91a54
commit
bc0719a145
@@ -878,8 +878,9 @@ pp.parseObjectProperty = function (prop, startPos, startLoc, isPattern, refShort
|
||||
}
|
||||
|
||||
if (!prop.computed && prop.key.type === "Identifier") {
|
||||
this.checkReservedWord(prop.key.name, prop.key.start, true, true);
|
||||
|
||||
if (isPattern) {
|
||||
this.checkReservedWord(prop.key.name, prop.key.start, true, true);
|
||||
prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
|
||||
} else if (this.match(tt.eq) && refShorthandDefaultPos) {
|
||||
if (!refShorthandDefaultPos.start) {
|
||||
|
||||
Reference in New Issue
Block a user