Commit 4c79544c authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[ast] AstTraversalVisitor should visit the Declarations of Block scopes

R=marja@chromium.org

Bug: v8:6509
Change-Id: If8be12e2ce6c00de0bdee38ab721ef5b7b47efe5
Reviewed-on: https://chromium-review.googlesource.com/556239Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46331}
parent 8516076a
......@@ -136,6 +136,9 @@ void AstTraversalVisitor<Subclass>::VisitFunctionDeclaration(
template <class Subclass>
void AstTraversalVisitor<Subclass>::VisitBlock(Block* stmt) {
PROCESS_NODE(stmt);
if (stmt->scope() != nullptr) {
RECURSE_EXPRESSION(VisitDeclarations(stmt->scope()->declarations()));
}
RECURSE(VisitStatements(stmt->statements()));
}
......
// 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.
(function testSloppy() {
var arrow = (sth = (function f() {
{
function f2() { }
}
})()) => 0;
assertEquals(0, arrow());
})();
(function testStrict() {
"use strict";
var arrow = (sth = (function f() {
{
function f2() { }
}
})()) => 0;
assertEquals(0, arrow());
})();
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