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

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

Issue 2638513002: Enable --harmony-trailing-commas (Closed)
Patch Set: Created 3 years, 11 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
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index d8705a654fd535d95fbe5fdcea017852e9241f40..0a9175e9ce81aa7afe0165f070bdeec5792765ea 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -216,7 +216,6 @@ class ParserBase {
allow_harmony_do_expressions_(false),
allow_harmony_function_sent_(false),
allow_harmony_restrictive_generators_(false),
- allow_harmony_trailing_commas_(false),
allow_harmony_class_fields_(false),
allow_harmony_object_spread_(false) {}
@@ -229,7 +228,6 @@ class ParserBase {
ALLOW_ACCESSORS(harmony_do_expressions);
ALLOW_ACCESSORS(harmony_function_sent);
ALLOW_ACCESSORS(harmony_restrictive_generators);
- ALLOW_ACCESSORS(harmony_trailing_commas);
ALLOW_ACCESSORS(harmony_class_fields);
ALLOW_ACCESSORS(harmony_object_spread);
@@ -1454,7 +1452,6 @@ class ParserBase {
bool allow_harmony_do_expressions_;
bool allow_harmony_function_sent_;
bool allow_harmony_restrictive_generators_;
- bool allow_harmony_trailing_commas_;
bool allow_harmony_class_fields_;
bool allow_harmony_object_spread_;
@@ -1908,8 +1905,7 @@ ParserBase<Impl>::ParseExpressionCoverGrammar(bool accept_IN, bool* ok) {
scanner()->location(), MessageTemplate::kParamAfterRest);
}
- if (allow_harmony_trailing_commas() && peek() == Token::RPAREN &&
- PeekAhead() == Token::ARROW) {
+ if (peek() == Token::RPAREN && PeekAhead() == Token::ARROW) {
// a trailing comma is allowed at the end of an arrow parameter list
break;
}
@@ -2616,7 +2612,7 @@ typename ParserBase<Impl>::ExpressionListT ParserBase<Impl>::ParseArguments(
done = (peek() != Token::COMMA);
if (!done) {
Next();
- if (allow_harmony_trailing_commas() && peek() == Token::RPAREN) {
+ if (peek() == Token::RPAREN) {
// allow trailing comma
done = true;
}
@@ -3552,7 +3548,7 @@ void ParserBase<Impl>::ParseFormalParameterList(FormalParametersT* parameters,
break;
}
if (!Check(Token::COMMA)) break;
- if (allow_harmony_trailing_commas() && peek() == Token::RPAREN) {
+ if (peek() == Token::RPAREN) {
// allow the trailing comma
break;
}
« src/flag-definitions.h ('K') | « src/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698