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:
committed by
Logan Smyth
parent
9add6d88f5
commit
2a8ebbe7ae
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user