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

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

Issue 1583863003: [parser] reject AssignmentElements with non-ASSIGN initializer ops (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 | « 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 760035dc7e6b7851de2264803910e703b8b7725f..679c2761a33c58fa491fb3d76bd8cff3b745874a 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2112,6 +2112,12 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN, int flags,
function_state_->AddProperty();
}
+ if (op != Token::ASSIGN && is_pattern_element) {
+ classifier->RecordAssignmentPatternError(
+ Scanner::Location(lhs_beg_pos, scanner()->location().end_pos),
+ MessageTemplate::kInvalidDestructuringTarget);
+ }
+
this->CheckAssigningFunctionLiteralToProperty(expression, right);
if (fni_ != NULL) {
« 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