diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h index 299b5ea7b4..f5ccf7abe4 100644 --- a/src/parsing/parser-base.h +++ b/src/parsing/parser-base.h @@ -1772,11 +1772,9 @@ ParserBase::ParsePrimaryExpression() { if (pattern_error) ArrowFormalParametersUnexpectedToken(); Consume(Token::LPAREN); if (Check(Token::RPAREN)) { - // ()=>x. The continuation that looks for the => is in + // ()=>x. The continuation that consumes the => is in // ParseAssignmentExpression. - classifier()->RecordExpressionError(scanner()->location(), - MessageTemplate::kUnexpectedToken, - Token::String(Token::RPAREN)); + if (peek() != Token::ARROW) ReportUnexpectedToken(Token::RPAREN); return factory()->NewEmptyParentheses(beg_pos); } // Heuristically try to detect immediately called functions before