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

Unified Diff: src/parsing/parser.cc

Issue 2368613002: [modules] Simplify treatment of empty imports. (Closed)
Patch Set: Created 4 years, 3 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/objects-inl.h ('k') | test/cctest/test-parsing.cc » ('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 29b26055c3d8e7519e097c6fe912437c63712242..6c0b58e2b2d2808096fcafe0a40bf606117d84ed 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1208,7 +1208,7 @@ void Parser::ParseImportDeclaration(bool* ok) {
if (tok == Token::STRING) {
const AstRawString* module_specifier = ParseModuleSpecifier(CHECK_OK_VOID);
ExpectSemicolon(CHECK_OK_VOID);
- module()->AddEmptyImport(module_specifier, scanner()->location(), zone());
+ module()->AddEmptyImport(module_specifier);
return;
}
@@ -1276,7 +1276,7 @@ void Parser::ParseImportDeclaration(bool* ok) {
if (named_imports != nullptr) {
if (named_imports->length() == 0) {
- module()->AddEmptyImport(module_specifier, scanner()->location(), zone());
+ module()->AddEmptyImport(module_specifier);
} else {
for (int i = 0; i < named_imports->length(); ++i) {
const NamedImport* import = named_imports->at(i);
@@ -1415,8 +1415,7 @@ Statement* Parser::ParseExportDeclaration(bool* ok) {
export_locations[i], zone());
}
} else if (length == 0) {
- module()->AddEmptyImport(module_specifier, scanner()->location(),
- zone());
+ module()->AddEmptyImport(module_specifier);
} else {
for (int i = 0; i < length; ++i) {
module()->AddExport(original_names[i], export_names[i],
« no previous file with comments | « src/objects-inl.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698