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

Unified Diff: src/parsing/parser-base.h

Issue 2252223002: Introduce ModuleScope subclass of DeclarationScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 192235dd77ca84b87495b48042e8c1a52f13f4dc..b3b516ead13d8256bdcfc39806911e9480cb9908 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -618,12 +618,8 @@ class ParserBase : public Traits {
return new (zone()) DeclarationScope(zone(), scope(), BLOCK_SCOPE);
}
- DeclarationScope* NewModuleScope(Scope* parent) {
- DeclarationScope* result =
- new (zone()) DeclarationScope(zone(), parent, MODULE_SCOPE);
- // TODO(verwaest): Move into the DeclarationScope constructor.
- result->DeclareThis(ast_value_factory());
- return result;
+ ModuleScope* NewModuleScope(DeclarationScope* parent) {
+ return new (zone()) ModuleScope(zone(), parent, ast_value_factory());
}
DeclarationScope* NewEvalScope(Scope* parent) {
@@ -1234,7 +1230,7 @@ class ParserBase : public Traits {
};
ModuleDescriptor* module() const {
- return scope()->AsDeclarationScope()->module();
+ return scope()->AsModuleScope()->module();
}
Scope* scope() const { return scope_state_->scope(); }
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698