Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 2849773002: Revert of Wrap ClassLiterals in DoExpressions instead of giving them BlockScopes. Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 3251b943a5ab64a7afc872ef033c9218ac940db5..9bee998048798d414cdc69ea9013d940bfd3e10a 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -1635,6 +1635,20 @@
void AstGraphBuilder::VisitClassLiteral(ClassLiteral* expr) {
+ // 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);
+ }
+}
+
+
+void AstGraphBuilder::VisitClassLiteralContents(ClassLiteral* expr) {
VisitForValueOrTheHole(expr->extends());
VisitForValue(expr->constructor());
« no previous file with comments | « src/compiler/ast-graph-builder.h ('k') | src/full-codegen/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698