Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index 669d5ae86d9f3af0e6188546956e1db07f5bf8ae..caf07ae5e420b703d444b000047402eb832cfb3b 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -1365,6 +1365,7 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
Expect(Token::RPAREN, CHECK_OK); |
if (peek() != Token::ARROW) { |
ValidateExpression(classifier, CHECK_OK); |
+ expr->set_is_parenthesized(); |
} |
return expr; |
} |
@@ -2041,7 +2042,8 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN, int flags, |
ExpressionClassifier::CoverInitializedNameProduction); |
bool maybe_pattern = |
- expression->IsObjectLiteral() || expression->IsArrayLiteral(); |
+ (expression->IsObjectLiteral() || expression->IsArrayLiteral()) && |
+ !expression->is_parenthesized(); |
if (!Token::IsAssignmentOp(peek())) { |
// Parsed conditional expression only (no assignment). |