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

Unified Diff: src/parser.cc

Issue 1094963002: [modules] Parsing: add ModuleRequests where missing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | test/cctest/test-parsing.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 53aa2ee2462ba2b55f4d150df5118d3a711097cf..fb52eef56382155d70889fa53efcc74ba8f5a700 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -1524,9 +1524,8 @@ Statement* Parser::ParseImportDeclaration(bool* ok) {
// 'import' ModuleSpecifier ';'
if (tok == Token::STRING) {
const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK);
+ scope_->module()->AddModuleRequest(module_specifier, zone());
ExpectSemicolon(CHECK_OK);
- // TODO(ES6): Add module to the requested modules of scope_->module().
- USE(module_specifier);
return factory()->NewEmptyStatement(pos);
}
@@ -1567,8 +1566,6 @@ Statement* Parser::ParseImportDeclaration(bool* ok) {
ExpectContextualKeyword(CStrVector("from"), CHECK_OK);
const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK);
- ExpectSemicolon(CHECK_OK);
-
scope_->module()->AddModuleRequest(module_specifier, zone());
if (module_instance_binding != NULL) {
@@ -1585,6 +1582,7 @@ Statement* Parser::ParseImportDeclaration(bool* ok) {
}
}
+ ExpectSemicolon(CHECK_OK);
return factory()->NewEmptyStatement(pos);
}
@@ -1660,9 +1658,9 @@ Statement* Parser::ParseExportDeclaration(bool* ok) {
Consume(Token::MUL);
ExpectContextualKeyword(CStrVector("from"), CHECK_OK);
const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK);
- ExpectSemicolon(CHECK_OK);
+ scope_->module()->AddModuleRequest(module_specifier, zone());
// TODO(ES6): scope_->module()->AddStarExport(...)
- USE(module_specifier);
+ ExpectSemicolon(CHECK_OK);
return factory()->NewEmptyStatement(pos);
}
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698