Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Unified Diff: src/preparser.h

Issue 1286133003: [es6] Remove redundant flag parameter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698