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

Unified Diff: sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart

Issue 13797002: Change MirrorSystem.libraries to Map<Uri, String> (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 years, 8 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
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.

Powered by Google App Engine
This is Rietveld 408576698