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

Unified Diff: src/parsing/parser.cc

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/globals.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index f60c05896f02cfd6f7590727343765f6034c85e6..da300a8139e148819ad9e89cef39582367ccd8ba 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1004,7 +1004,8 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
}
outer = NewEvalScope(outer);
} else if (info->is_module()) {
- outer = NewModuleScope(outer);
+ DCHECK_EQ(outer, info->script_scope());
+ outer = NewModuleScope(info->script_scope());
}
DeclarationScope* scope = outer->AsDeclarationScope();
@@ -1023,7 +1024,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
if (parsing_module_) {
ParseModuleItemList(body, &ok);
ok = ok &&
- module()->Validate(this->scope()->AsDeclarationScope(),
+ module()->Validate(this->scope()->AsModuleScope(),
&pending_error_handler_, zone());
} else {
// Don't count the mode in the use counters--give the program a chance
« no previous file with comments | « src/globals.h ('k') | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698