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}
This commit is contained in:
parent
148a903d92
commit
aff64e9dfa
@ -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
|
||||
|
6
test/mjsunit/regress/regress-679727.js
Normal file
6
test/mjsunit/regress/regress-679727.js
Normal file
@ -0,0 +1,6 @@
|
||||
// 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)
|
Loading…
Reference in New Issue
Block a user