Index: src/preparser.h |
diff --git a/src/preparser.h b/src/preparser.h |
index 7bf08458750b94ab76a738aab5347ba0bc402bf3..eb0bc11b0b5e53c31d0a333057721e28770b4eb7 100644 |
--- a/src/preparser.h |
+++ b/src/preparser.h |
@@ -698,8 +698,7 @@ class ParserBase : public Traits { |
ExpressionT ParseStrongSuperCallExpression(ExpressionClassifier* classifier, |
bool* ok); |
- void ParseFormalParameter(bool is_rest, |
- FormalParametersT* parameters, |
+ void ParseFormalParameter(FormalParametersT* parameters, |
ExpressionClassifier* classifier, bool* ok); |
void ParseFormalParameterList(FormalParametersT* parameters, |
ExpressionClassifier* classifier, bool* ok); |
@@ -2281,9 +2280,8 @@ ParserBase<Traits>::ParsePrimaryExpression(ExpressionClassifier* classifier, |
FormalParametersT formals(scope); |
scope->set_start_position(beg_pos); |
ExpressionClassifier formals_classifier; |
- const bool is_rest = true; |
- this->ParseFormalParameter(is_rest, &formals, &formals_classifier, |
- CHECK_OK); |
+ formals.has_rest = true; |
+ this->ParseFormalParameter(&formals, &formals_classifier, CHECK_OK); |
Traits::DeclareFormalParameter( |
formals.scope, formals.at(0), formals.is_simple, |
&formals_classifier); |
@@ -3622,10 +3620,10 @@ ParserBase<Traits>::ParseMemberExpressionContinuation( |
template <class Traits> |
void ParserBase<Traits>::ParseFormalParameter( |
- bool is_rest, FormalParametersT* parameters, |
- ExpressionClassifier* classifier, bool* ok) { |
+ FormalParametersT* parameters, ExpressionClassifier* classifier, bool* ok) { |
// FormalParameter[Yield,GeneratorParameter] : |
// BindingElement[?Yield, ?GeneratorParameter] |
+ bool is_rest = parameters->has_rest; |
Token::Value next = peek(); |
ExpressionT pattern = ParsePrimaryExpression(classifier, ok); |
@@ -3679,8 +3677,9 @@ void ParserBase<Traits>::ParseFormalParameterList( |
*ok = false; |
return; |
} |
- bool is_rest = allow_harmony_rest_parameters() && Check(Token::ELLIPSIS); |
- ParseFormalParameter(is_rest, parameters, classifier, ok); |
+ parameters->has_rest = |
+ allow_harmony_rest_parameters() && Check(Token::ELLIPSIS); |
+ ParseFormalParameter(parameters, classifier, ok); |
if (!*ok) return; |
} while (!parameters->has_rest && Check(Token::COMMA)); |