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

Unified Diff: src/parser.cc

Issue 1413903002: Always give class literals a block scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: TurboFan cleanup Created 5 years, 2 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/full-codegen/full-codegen.cc ('k') | no next file » | 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 3d61c7e71b0ba921ffae9a0ebf2cf5efadbf7b36..e3a62c1ab2b93a5679f5201191bfe9d82ee26f97 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -4895,15 +4895,13 @@ ClassLiteral* Parser::ParseClassLiteral(const AstRawString* name,
block_scope->language_mode());
}
+ // Note that we do not finalize this block scope because strong
+ // mode uses it as a sentinel value indicating an anonymous class.
block_scope->set_end_position(end_pos);
if (name != NULL) {
DCHECK_NOT_NULL(proxy);
proxy->var()->set_initializer_position(end_pos);
- } else {
- // Unnamed classes should not have scopes (the scope will be empty).
- DCHECK_EQ(block_scope->num_var_or_const(), 0);
- block_scope = nullptr;
}
return factory()->NewClassLiteral(name, block_scope, proxy, extends,
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698