Commit aff64e9d authored by marja's avatar marja Committed by Commit bot

Parser: Fix InitializerRewriter.

The bug was caused by AstTraversalVisitor refactoring:
https://codereview.chromium.org/2169833002/

InitializerRewriter::VisitRewritableExpression in parser.cc didn't recurse; so
it fails when a rewritable expression contains another rewritable expression.

See the bug for more details.

BUG=chromium:679727

Review-Url: https://codereview.chromium.org/2629623002
Cr-Commit-Position: refs/heads/master@{#42274}
parent 148a903d
......@@ -2839,6 +2839,7 @@ class InitializerRewriter final
if (to_rewrite->is_rewritten()) return;
Parser::PatternRewriter::RewriteDestructuringAssignment(parser_, to_rewrite,
scope_);
AstTraversalVisitor::VisitRewritableExpression(to_rewrite);
}
// Code in function literals does not need to be eagerly rewritten, it will be
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
f = (e=({} = {} = 1)) => {}; f(1);
((e = ({} = {} = {})) => {})(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment