Index: runtime/vm/parser.cc |
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
index 8512cd32f7803774cc7f86a0782fd616c1d33c37..43a5e396471f0e438975215ce59fa36c82367970 100644 |
--- a/runtime/vm/parser.cc |
+++ b/runtime/vm/parser.cc |
@@ -4939,7 +4939,7 @@ void Parser::ParseIdentList(GrowableObjectArray* names) { |
} |
-void Parser::ParseLibraryImportExport() { |
+void Parser::ParseLibraryImportExport(intptr_t metadata_pos) { |
bool is_import = (CurrentToken() == Token::kIMPORT); |
bool is_export = (CurrentToken() == Token::kEXPORT); |
ASSERT(is_import || is_export); |
@@ -5002,8 +5002,13 @@ void Parser::ParseLibraryImportExport() { |
library.Register(); |
} |
} |
- const Namespace& ns = |
- Namespace::Handle(Namespace::New(library, show_names, hide_names)); |
+ |
+ Namespace& ns = |
+ Namespace::Handle(Namespace::New(library, show_names, hide_names)); |
+ if (metadata_pos >= 0) { |
+ ns.AddMetadata(metadata_pos, current_class()); |
+ } |
+ |
if (is_import) { |
// Ensure that private dart:_ libraries are only imported into dart: |
// libraries. |
@@ -5076,7 +5081,7 @@ void Parser::ParseLibraryDefinition() { |
} |
while ((CurrentToken() == Token::kIMPORT) || |
(CurrentToken() == Token::kEXPORT)) { |
- ParseLibraryImportExport(); |
+ ParseLibraryImportExport(metadata_pos); |
rewind_pos = TokenPos(); |
metadata_pos = SkipMetadata(); |
} |