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

Unified Diff: src/parsing/pattern-rewriter.cc

Issue 1906633002: Version 5.0.71.34 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.0
Patch Set: Created 4 years, 8 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 | « include/v8-version.h ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/pattern-rewriter.cc
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc
index 04b517ebba4ba0928994237360387df279d1cc92..768a9488632675359f9fcb43df6ef8c05368456f 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -77,7 +77,11 @@ bool Parser::PatternRewriter::IsBindingContext(PatternContext c) const {
Parser::PatternRewriter::PatternContext
Parser::PatternRewriter::SetAssignmentContextIfNeeded(Expression* node) {
PatternContext old_context = context();
- if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN) {
+ // AssignmentExpressions may occur in the Initializer position of a
+ // SingleNameBinding. Such expressions should not prompt a change in the
+ // pattern's context.
+ if (node->IsAssignment() && node->AsAssignment()->op() == Token::ASSIGN &&
+ !IsInitializerContext()) {
set_context(ASSIGNMENT);
}
return old_context;
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698