Index: src/parsing/pattern-rewriter.cc |
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc |
index 3ecffb99dbd763f26a5a13756092fb5e8006a64b..1d93271e6e72d3f2e7257340d7ffb3e367278fb3 100644 |
--- a/src/parsing/pattern-rewriter.cc |
+++ b/src/parsing/pattern-rewriter.cc |
@@ -79,7 +79,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; |