Index: sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart |
index dd8c70fdbaacd0c2c1d29af60fce3ec72b454f24..de1cedad5dd3813b662195ec79c8a23786662ed5 100644 |
--- a/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart |
+++ b/sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart |
@@ -17,8 +17,16 @@ abstract class MirrorSystem { |
/** |
* Returns an unmodifiable map of all libraries in this mirror system. |
*/ |
- // TODO(johnniwinther): Change to Map<Uri, LibraryMirror>. |
- Map<String, LibraryMirror> get libraries; |
+ Map<Uri, LibraryMirror> get libraries; |
+ |
+ /** |
+ * Returns an iterable of all libraries in the mirror system whose library |
+ * name is [libraryName]. |
+ */ |
+ Iterable<LibraryMirror> findLibrary(String libraryName) { |
+ return libraries.values.where( |
+ (library) => library.simpleName == libraryName); |
+ } |
/** |
* A mirror on the [:dynamic:] type. |