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

Unified Diff: src/preparser.cc

Issue 1247443004: [es6] Some renamings and minor clean-ups in parameter parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove accidental line Created 5 years, 5 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/preparser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index a26b2a8975052eb71f4b27f69b8dc238ccfe91c4..d60fa5659d8c460f004b62f9b97ec240b2268ab1 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -1052,14 +1052,13 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
Expect(Token::LPAREN, CHECK_OK);
int start_position = scanner()->location().beg_pos;
function_scope->set_start_position(start_position);
- PreParserFormalParameterParsingState parsing_state(nullptr);
- int num_parameters =
- ParseFormalParameterList(&parsing_state, &formals_classifier, CHECK_OK);
+ PreParserFormalParameters formals(nullptr);
+ int arity = ParseFormalParameterList(&formals, &formals_classifier, CHECK_OK);
Expect(Token::RPAREN, CHECK_OK);
int formals_end_position = scanner()->location().end_pos;
- CheckArityRestrictions(num_parameters, arity_restriction,
- parsing_state.has_rest, start_position,
+ CheckArityRestrictions(arity, arity_restriction,
+ formals.has_rest, start_position,
formals_end_position, CHECK_OK);
// See Parser::ParseFunctionLiteral for more information about lazy parsing
@@ -1083,10 +1082,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
// function, since the function can declare itself strict.
CheckFunctionName(language_mode, function_name, function_name_validity,
function_name_location, CHECK_OK);
- const bool strict_formal_parameters =
- !parsing_state.is_simple_parameter_list || IsConciseMethod(kind);
const bool allow_duplicate_parameters =
- is_sloppy(language_mode) && !strict_formal_parameters;
+ is_sloppy(language_mode) && formals.is_simple && !IsConciseMethod(kind);
ValidateFormalParameters(&formals_classifier, language_mode,
allow_duplicate_parameters, CHECK_OK);
« no previous file with comments | « src/preparser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698