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

Unified Diff: runtime/vm/parser.cc

Issue 154733003: Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 6 years, 10 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 | « runtime/vm/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698