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

Unified Diff: src/parsing/parser-base.h

Issue 2091313002: [parser] don't report error for CoverInitializedNames in async arrow formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: _Really_ fix compile error Created 4 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 | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index f8a15a47961075986405fa5bd4781a47eca0e490..3916c946ac9d9aa1474685855817fb6258557838 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2160,7 +2160,10 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments(
ExpressionT argument = this->ParseAssignmentExpression(
true, classifier, CHECK_OK_CUSTOM(NullExpressionList));
CheckNoTailCallExpressions(classifier, CHECK_OK_CUSTOM(NullExpressionList));
- Traits::RewriteNonPattern(classifier, CHECK_OK_CUSTOM(NullExpressionList));
+ if (!maybe_arrow) {
+ Traits::RewriteNonPattern(classifier,
+ CHECK_OK_CUSTOM(NullExpressionList));
+ }
if (is_spread) {
if (!spread_arg.IsValid()) {
spread_arg.beg_pos = start_pos;
@@ -2197,11 +2200,17 @@ typename Traits::Type::ExpressionList ParserBase<Traits>::ParseArguments(
}
*first_spread_arg_loc = spread_arg;
- if ((!maybe_arrow || peek() != Token::ARROW) && spread_arg.IsValid()) {
- // Unspread parameter sequences are translated into array literals in the
- // parser. Ensure that the number of materialized literals matches between
- // the parser and preparser
- Traits::MaterializeUnspreadArgumentsLiterals(unspread_sequences_count);
+ if (!maybe_arrow || peek() != Token::ARROW) {
+ if (maybe_arrow) {
+ Traits::RewriteNonPattern(classifier,
+ CHECK_OK_CUSTOM(NullExpressionList));
+ }
+ if (spread_arg.IsValid()) {
+ // Unspread parameter sequences are translated into array literals in the
+ // parser. Ensure that the number of materialized literals matches between
+ // the parser and preparser
+ Traits::MaterializeUnspreadArgumentsLiterals(unspread_sequences_count);
+ }
}
return result;
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698