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

Unified Diff: src/parser.cc

Issue 1102903002: [strong] Simplify the classes-referring-to-classes check. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: oops Created 5 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 | « no previous file | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index f97174136887ae5be63b81dc44b3a8eea62b9da2..af186270ee87307f13fd3694bf7c9de8aa78c9b3 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2199,6 +2199,10 @@ Statement* Parser::ParseClassDeclaration(ZoneList<const AstRawString*>* names,
scope_->class_declaration_group_start());
Variable* outer_class_variable = Declare(declaration, true, CHECK_OK);
proxy->var()->set_initializer_position(position());
+ // This is needed because a class ("class Name { }") creates two bindings (one
+ // in the outer scope, and one in the class scope). The method is a function
+ // scope inside the inner scope (class scope). The consecutive class
+ // declarations are in the outer scope.
if (value->class_variable_proxy() && value->class_variable_proxy()->var() &&
outer_class_variable->is_class()) {
// In some cases, the outer variable is not detected as a class variable;
@@ -2208,8 +2212,8 @@ Statement* Parser::ParseClassDeclaration(ZoneList<const AstRawString*>* names,
value->class_variable_proxy()
->var()
->AsClassVariable()
- ->set_corresponding_outer_class_variable(
- outer_class_variable->AsClassVariable());
+ ->set_declaration_group_start(
+ outer_class_variable->AsClassVariable()->declaration_group_start());
}
Token::Value init_op =
« no previous file with comments | « no previous file | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698