summaryrefslogtreecommitdiff
path: root/deps/v8/src/parsing/expression-scope-reparenter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/parsing/expression-scope-reparenter.cc')
-rw-r--r--deps/v8/src/parsing/expression-scope-reparenter.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/v8/src/parsing/expression-scope-reparenter.cc b/deps/v8/src/parsing/expression-scope-reparenter.cc
index 6ca29611c1..18c52add11 100644
--- a/deps/v8/src/parsing/expression-scope-reparenter.cc
+++ b/deps/v8/src/parsing/expression-scope-reparenter.cc
@@ -27,6 +27,7 @@ class Reparenter final : public AstTraversalVisitor<Reparenter> {
void VisitFunctionLiteral(FunctionLiteral* expr);
void VisitClassLiteral(ClassLiteral* expr);
void VisitVariableProxy(VariableProxy* expr);
+ void VisitRewritableExpression(RewritableExpression* expr);
void VisitBlock(Block* stmt);
void VisitTryCatchStatement(TryCatchStatement* stmt);
@@ -45,6 +46,12 @@ void Reparenter::VisitClassLiteral(ClassLiteral* class_literal) {
// scope on its scope chain.
DCHECK_EQ(class_literal->constructor()->scope()->outer_scope(),
class_literal->scope());
+
+ if (class_literal->static_fields_initializer() != nullptr) {
+ DCHECK_EQ(
+ class_literal->static_fields_initializer()->scope()->outer_scope(),
+ class_literal->scope());
+ }
#if DEBUG
// The same goes for the rest of the class, but we do some
// sanity checking in debug mode.
@@ -72,6 +79,11 @@ void Reparenter::VisitVariableProxy(VariableProxy* proxy) {
}
}
+void Reparenter::VisitRewritableExpression(RewritableExpression* expr) {
+ Visit(expr->expression());
+ expr->set_scope(scope_);
+}
+
void Reparenter::VisitBlock(Block* stmt) {
if (stmt->scope() != nullptr)
stmt->scope()->ReplaceOuterScope(scope_);