Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 7ab02d6a1beca263ca9fc7c208074f99ff5e881e..61d63c7cec2624b3588383b763d71fd499d61f89 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -1154,7 +1154,8 @@ ZoneList<const Parser::NamedImport*>* Parser::ParseNamedImports( |
return nullptr; |
} |
- DeclareModuleImport(local_name, position(), CHECK_OK); |
+ DeclareVariable(local_name, CONST, kNeedsInitialization, position(), |
+ CHECK_OK); |
NamedImport* import = |
new (zone()) NamedImport(import_name, local_name, location); |
@@ -1204,7 +1205,8 @@ void Parser::ParseImportDeclaration(bool* ok) { |
import_default_binding = |
ParseIdentifier(kDontAllowRestrictedIdentifiers, CHECK_OK_VOID); |
import_default_binding_loc = scanner()->location(); |
- DeclareModuleImport(import_default_binding, pos, CHECK_OK_VOID); |
+ DeclareVariable(import_default_binding, CONST, kNeedsInitialization, pos, |
+ CHECK_OK_VOID); |
} |
// Parse NameSpaceImport or NamedImports if present. |
@@ -1481,21 +1483,6 @@ Declaration* Parser::DeclareVariable(const AstRawString* name, |
return declaration; |
} |
-Declaration* Parser::DeclareModuleImport(const AstRawString* name, int pos, |
- bool* ok) { |
- DCHECK_EQ(MODULE_SCOPE, scope()->scope_type()); |
- Declaration* decl = |
- DeclareVariable(name, CONST, kNeedsInitialization, pos, CHECK_OK); |
- // Allocate imports eagerly as hole check elimination logic in scope |
- // analisys depends on identifying imports. |
- // TODO(adamk): It's weird to allocate imports long before everything |
- // else. We should find a different way of filtering out imports |
- // during hole check elimination. |
- decl->proxy()->var()->AllocateTo(VariableLocation::MODULE, |
- Variable::kModuleImportIndex); |
- return decl; |
-} |
- |
Variable* Parser::Declare(Declaration* declaration, |
DeclarationDescriptor::Kind declaration_kind, |
VariableMode mode, InitializationFlag init, bool* ok, |