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

Unified Diff: src/preparser.cc

Issue 1195163007: Revert of [destructuring] Implement parameter pattern matching. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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') | src/scopes.cc » ('j') | 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 cfb8a3e3d53525ac0255bbb68e4738ac75185411..3a53151399a19f04d65cc5b0258ebc92a5ebc2e4 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -1038,18 +1038,17 @@
DuplicateFinder duplicate_finder(scanner()->unicode_cache());
ExpressionClassifier formals_classifier(&duplicate_finder);
+ bool has_rest = false;
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);
+ int num_parameters = ParseFormalParameterList(nullptr, &has_rest,
+ &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,
- formals_end_position, CHECK_OK);
+ CheckArityRestrictions(num_parameters, arity_restriction, has_rest,
+ start_position, formals_end_position, CHECK_OK);
// See Parser::ParseFunctionLiteral for more information about lazy parsing
// and lazy compilation.
@@ -1069,8 +1068,7 @@
// function, since the function can declare itself strict.
CheckFunctionName(language_mode(), kind, function_name,
name_is_strict_reserved, function_name_location, CHECK_OK);
- const bool strict_formal_parameters =
- !parsing_state.is_simple_parameter_list || IsConciseMethod(kind);
+ const bool strict_formal_parameters = has_rest || IsConciseMethod(kind);
const bool allow_duplicate_parameters =
is_sloppy(language_mode()) && !strict_formal_parameters;
ValidateFormalParameters(&formals_classifier, language_mode(),
« no previous file with comments | « src/preparser.h ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698