Commit 30a7d497 authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Rename parameter-initializer-rewriter.cc to match its current use

Change-Id: Idb6dfed1d0314c38c25b230faa7e28728cff2637
Reviewed-on: https://chromium-review.googlesource.com/587250
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47019}
parent 9dc664bb
......@@ -1766,10 +1766,10 @@ v8_source_set("v8_base") {
"src/ostreams.h",
"src/parsing/duplicate-finder.h",
"src/parsing/expression-classifier.h",
"src/parsing/expression-scope-reparenter.cc",
"src/parsing/expression-scope-reparenter.h",
"src/parsing/func-name-inferrer.cc",
"src/parsing/func-name-inferrer.h",
"src/parsing/parameter-initializer-rewriter.cc",
"src/parsing/parameter-initializer-rewriter.h",
"src/parsing/parse-info.cc",
"src/parsing/parse-info.h",
"src/parsing/parser-base.h",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/parsing/parameter-initializer-rewriter.h"
#include "src/parsing/expression-scope-reparenter.h"
#include "src/ast/ast-traversal-visitor.h"
#include "src/ast/ast.h"
......@@ -14,7 +14,6 @@ namespace internal {
namespace {
class Rewriter final : public AstTraversalVisitor<Rewriter> {
public:
Rewriter(uintptr_t stack_limit, Expression* initializer, Scope* scope)
......@@ -40,7 +39,6 @@ void Rewriter::VisitFunctionLiteral(FunctionLiteral* function_literal) {
function_literal->scope()->ReplaceOuterScope(scope_);
}
void Rewriter::VisitClassLiteral(ClassLiteral* class_literal) {
class_literal->scope()->ReplaceOuterScope(scope_);
// No need to visit the constructor since it will have the class
......@@ -62,7 +60,6 @@ void Rewriter::VisitClassLiteral(ClassLiteral* class_literal) {
#endif
}
void Rewriter::VisitVariableProxy(VariableProxy* proxy) {
if (!proxy->is_resolved()) {
if (scope_->outer_scope()->RemoveUnresolved(proxy)) {
......@@ -75,7 +72,6 @@ void Rewriter::VisitVariableProxy(VariableProxy* proxy) {
}
}
void Rewriter::VisitBlock(Block* stmt) {
if (stmt->scope() != nullptr)
stmt->scope()->ReplaceOuterScope(scope_);
......@@ -83,19 +79,16 @@ void Rewriter::VisitBlock(Block* stmt) {
VisitStatements(stmt->statements());
}
void Rewriter::VisitTryCatchStatement(TryCatchStatement* stmt) {
Visit(stmt->try_block());
stmt->scope()->ReplaceOuterScope(scope_);
}
void Rewriter::VisitWithStatement(WithStatement* stmt) {
Visit(stmt->expression());
stmt->scope()->ReplaceOuterScope(scope_);
}
} // anonymous namespace
void ReparentExpressionScope(uintptr_t stack_limit, Expression* expr,
......@@ -116,6 +109,5 @@ void ReparentExpressionScope(uintptr_t stack_limit, Expression* expr,
rewriter.Run();
}
} // namespace internal
} // namespace v8
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_
#define V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_
#ifndef V8_PARSING_EXPRESSION_SCOPE_REPARENTER_H_
#define V8_PARSING_EXPRESSION_SCOPE_REPARENTER_H_
#include <stdint.h>
......@@ -27,4 +27,4 @@ void ReparentExpressionScope(uintptr_t stack_limit, Expression* expr,
} // namespace internal
} // namespace v8
#endif // V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_
#endif // V8_PARSING_EXPRESSION_SCOPE_REPARENTER_H_
......@@ -19,7 +19,7 @@
#include "src/messages.h"
#include "src/objects-inl.h"
#include "src/parsing/duplicate-finder.h"
#include "src/parsing/parameter-initializer-rewriter.h"
#include "src/parsing/expression-scope-reparenter.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/rewriter.h"
#include "src/parsing/scanner-character-streams.h"
......
......@@ -5,7 +5,7 @@
#include "src/ast/ast.h"
#include "src/messages.h"
#include "src/objects-inl.h"
#include "src/parsing/parameter-initializer-rewriter.h"
#include "src/parsing/expression-scope-reparenter.h"
#include "src/parsing/parser.h"
namespace v8 {
......
......@@ -1208,10 +1208,10 @@
'ostreams.h',
'parsing/duplicate-finder.h',
'parsing/expression-classifier.h',
'parsing/expression-scope-reparenter.cc',
'parsing/expression-scope-reparenter.h',
'parsing/func-name-inferrer.cc',
'parsing/func-name-inferrer.h',
'parsing/parameter-initializer-rewriter.cc',
'parsing/parameter-initializer-rewriter.h',
'parsing/parse-info.cc',
'parsing/parse-info.h',
'parsing/parser-base.h',
......
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