Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 6ce9269927c645fd16b8f6b431606bcd8101f570..b24db9f40d8c954bfaa610f3e5d0d8ff6b3dbd26 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1527,20 +1527,15 @@ void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) { |
- if (expr->scope() == NULL) { |
- // Visit class literal in the same scope, no declarations. |
+ // Visit declarations and class literal in a block scope. |
+ if (expr->scope()->ContextLocalCount() > 0) { |
+ Node* context = BuildLocalBlockContext(expr->scope()); |
+ ContextScope scope(this, expr->scope(), context); |
+ VisitDeclarations(expr->scope()->declarations()); |
VisitClassLiteralContents(expr); |
} else { |
- // Visit declarations and class literal in a block scope. |
- if (expr->scope()->ContextLocalCount() > 0) { |
- Node* context = BuildLocalBlockContext(expr->scope()); |
- ContextScope scope(this, expr->scope(), context); |
- VisitDeclarations(expr->scope()->declarations()); |
- VisitClassLiteralContents(expr); |
- } else { |
- VisitDeclarations(expr->scope()->declarations()); |
- VisitClassLiteralContents(expr); |
- } |
+ VisitDeclarations(expr->scope()->declarations()); |
+ VisitClassLiteralContents(expr); |
} |
} |
@@ -1638,8 +1633,7 @@ void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) { |
literal = NewNode(op, literal, proto); |
// Assign to class variable. |
- if (expr->scope() != NULL) { |
- DCHECK_NOT_NULL(expr->class_variable_proxy()); |
+ if (expr->class_variable_proxy() != nullptr) { |
Variable* var = expr->class_variable_proxy()->var(); |
FrameStateBeforeAndAfter states(this, BailoutId::None()); |
VectorSlotPair feedback = CreateVectorSlotPair( |