Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index 83c8375197db75ad352b8bbb98a3fd587825ac3c..e44ebe01f4f6e4ee4d7e010c6ba808dc4480da26 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -1312,7 +1312,9 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
if (!classifier->is_valid_binding_pattern()) { |
ArrowFormalParametersUnexpectedToken(classifier); |
} |
- BindingPatternUnexpectedToken(classifier); |
+ classifier->RecordPatternError(scanner()->peek_location(), |
+ MessageTemplate::kUnexpectedToken, |
+ Token::String(Token::LPAREN)); |
Consume(Token::LPAREN); |
if (Check(Token::RPAREN)) { |
// ()=>x. The continuation that looks for the => is in |
@@ -1356,9 +1358,6 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
ExpressionT expr = this->ParseExpression(true, kIsPossibleArrowFormals, |
classifier, CHECK_OK); |
Expect(Token::RPAREN, CHECK_OK); |
- if (peek() != Token::ARROW) { |
- expr->set_is_parenthesized(); |
- } |
return expr; |
} |
@@ -2025,8 +2024,7 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN, int flags, |
ExpressionClassifier::CoverInitializedNameProduction); |
bool maybe_pattern = |
- (expression->IsObjectLiteral() || expression->IsArrayLiteral()) && |
- !expression->is_parenthesized(); |
+ expression->IsObjectLiteral() || expression->IsArrayLiteral(); |
if (!Token::IsAssignmentOp(peek())) { |
// Parsed conditional expression only (no assignment). |
@@ -3314,9 +3312,6 @@ void ParserBase<Traits>::CheckDestructuringElement( |
const Scanner::Location location(begin, end); |
if (expression->IsArrayLiteral() || expression->IsObjectLiteral() || |
expression->IsAssignment()) { |
- if (expression->is_parenthesized()) { |
- classifier->RecordPatternError(location, message); |
- } |
return; |
} |