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

Unified Diff: src/parsing/preparser.cc

Issue 1570793002: [parser] parenthesized Literals are not valid AssignmentPatterns (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
Index: src/parsing/preparser.cc
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc
index 4af7fca7b7160293229d8d8b9c47feb7526a28fc..cca31a9bc7820d8bf23887f93d29a6669c24c134 100644
--- a/src/parsing/preparser.cc
+++ b/src/parsing/preparser.cc
@@ -591,7 +591,8 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
}
}
- is_pattern = pattern.IsObjectLiteral() || pattern.IsArrayLiteral();
+ is_pattern = (pattern.IsObjectLiteral() || pattern.IsArrayLiteral()) &&
+ !pattern.is_parenthesized();
bool is_for_iteration_variable =
var_context == kForStatement &&

Powered by Google App Engine
This is Rietveld 408576698