Remove parenthesizedArgument (#7981)

The extra field parenthesizedArgument was never set to true. It was
always set to false and the code that read this was incorrectly
checking if extra was present.

Fixes #7957
This commit is contained in:
Erik Arvidsson
2018-05-29 13:58:21 -07:00
committed by Logan Smyth
parent 9add6d88f5
commit 2a8ebbe7ae
65 changed files with 14 additions and 254 deletions

View File

@@ -287,9 +287,7 @@ export default class ExpressionParser extends LValParser {
if (
operator === "**" &&
left.type === "UnaryExpression" &&
left.extra &&
!left.extra.parenthesizedArgument &&
!left.extra.parenthesized
!(left.extra && left.extra.parenthesized)
) {
this.raise(
left.argument.start,
@@ -364,16 +362,8 @@ export default class ExpressionParser extends LValParser {
}
this.next();
const argType = this.state.type;
node.argument = this.parseMaybeUnary();
this.addExtra(
node,
"parenthesizedArgument",
argType === tt.parenL &&
(!node.argument.extra || !node.argument.extra.parenthesized),
);
if (refShorthandDefaultPos && refShorthandDefaultPos.start) {
this.unexpected(refShorthandDefaultPos.start);
}