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

Unified Diff: src/parsing/parser.cc

Issue 1570793002: [parser] parenthesized Literals are not valid AssignmentPatterns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO + move ParenthesizedField line above Type-dependent fields/comments 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/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 74fc00b7e480dbaf493282135560adae8b5698b0..335b23ad6599e3bbb534ecf19e9a491e639814e6 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -2366,7 +2366,9 @@ void Parser::ParseVariableDeclarations(VariableDeclarationContext var_context,
}
}
- bool is_pattern = pattern->IsObjectLiteral() || pattern->IsArrayLiteral();
+ bool is_pattern =
+ (pattern->IsObjectLiteral() || pattern->IsArrayLiteral()) &&
+ !pattern->is_parenthesized();
Scanner::Location variable_loc = scanner()->location();
const AstRawString* single_name =
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698