Commit d5370d15 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Remove RETURN_IF* from ParseFormalParameter

Bug: v8:8363, v8:7926
Change-Id: I956bdd92688d4dddedca4a6ca844344072bad3f7
Reviewed-on: https://chromium-review.googlesource.com/c/1299085
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56987}
parent 5d1b7c37
......@@ -3594,11 +3594,11 @@ void ParserBase<Impl>::ParseFormalParameter(FormalParametersT* parameters) {
FuncNameInferrerState fni_state(&fni_);
ExpressionT pattern = ParseBindingPattern();
// TODO(verwaest): Remove once we have FailureExpression.
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
if (!impl()->IsIdentifier(pattern)) {
parameters->is_simple = false;
ValidateFormalParameterInitializer();
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
}
ExpressionT initializer = impl()->NullExpression();
......@@ -3610,14 +3610,13 @@ void ParserBase<Impl>::ParseFormalParameter(FormalParametersT* parameters) {
{
ExpressionClassifier init_classifier(this);
initializer = ParseAssignmentExpression(true);
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
ValidateExpression();
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
ValidateFormalParameterInitializer();
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
parameters->is_simple = false;
}
classifier()->RecordNonSimpleParameter();
// TODO(verwaest): Remove once we have FailureExpression.
RETURN_IF_PARSE_ERROR_CUSTOM(Void);
impl()->SetFunctionNameFromIdentifierRef(initializer, pattern);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment