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

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

Issue 2297303003: Fix bug with nested spreads as patterns (Closed)
Patch Set: Created 4 years, 3 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/mjsunit/es6/regress/regress-5337.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 af6060a44ba992f20191478a472190b9399bb333..e5211b41947156c64bf9477ec83015a69ec059ad 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -261,12 +261,14 @@ Variable* Parser::PatternRewriter::CreateTempVar(Expression* value) {
void Parser::PatternRewriter::VisitRewritableExpression(
RewritableExpression* node) {
// If this is not a destructuring assignment...
- if (!IsAssignmentContext() || !node->expression()->IsAssignment()) {
+ if (!IsAssignmentContext()) {
// Mark the node as rewritten to prevent redundant rewriting, and
// perform BindingPattern rewriting
DCHECK(!node->is_rewritten());
node->Rewrite(node->expression());
return Visit(node->expression());
+ } else if (!node->expression()->IsAssignment()) {
+ return Visit(node->expression());
caitp 2016/09/01 15:34:41 my understanding is, this will recursively continu
}
if (node->is_rewritten()) return;
« no previous file with comments | « no previous file | test/mjsunit/es6/regress/regress-5337.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698