use extra.parenthesized rather than parenthesizedExpression

This commit is contained in:
Sebastian McKenzie 2015-09-15 06:19:26 +01:00
parent 25aa6da989
commit fbda587964

View File

@ -109,7 +109,7 @@ pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse) {
node.left = this.match(tt.eq) ? this.toAssignable(left) : left;
refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly
this.checkLVal(left);
if (left.parenthesizedExpression) {
if (left.extra && left.extra.parenthesized) {
let errorMsg;
if (left.type === "ObjectPattern") {
errorMsg = "`({a}) = 0` use `({a} = 0)`";
@ -540,8 +540,7 @@ pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow
} else {
val = exprList[0];
}
val.parenthesizedExpression = true;
this.addExtra(val, "parenthesized", true);
return val;
};