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

Unified Diff: src/parsing/preparser.cc

Issue 1661193002: Remove unused 'needs_init' member of ParsingResult (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index b04fa792249f81e279f70c039335e26e2187d003..6eb220921c3a7165c74d6d83ed15f38d499105fb 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -591,12 +591,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
}
}
- is_pattern = (pattern.IsObjectLiteral() || pattern.IsArrayLiteral()) &&
- !pattern.is_parenthesized();
-
- bool is_for_iteration_variable =
- var_context == kForStatement &&
- (peek() == Token::IN || PeekContextualKeyword(CStrVector("of")));
+ is_pattern = pattern.IsObjectLiteral() || pattern.IsArrayLiteral();
Scanner::Location variable_loc = scanner()->location();
nvars++;
@@ -611,7 +606,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
*first_initializer_loc = variable_loc;
}
} else if ((require_initializer || is_pattern) &&
- !is_for_iteration_variable) {
+ (var_context != kForStatement || !PeekInOrOf())) {
PreParserTraits::ReportMessageAt(
Scanner::Location(decl_pos, scanner()->location().end_pos),
MessageTemplate::kDeclarationMissingInitializer,
« no previous file with comments | « src/parsing/parser-base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698