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

Unified Diff: lib/dartdoc/mirrors/mirrors_util.dart

Issue 10701091: Dartdoc and Apidoc updated to use dart2js through the mirror system. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: create-sdk.py updated Created 8 years, 5 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: lib/dartdoc/mirrors/mirrors_util.dart
diff --git a/lib/dartdoc/mirrors/mirrors_util.dart b/lib/dartdoc/mirrors/mirrors_util.dart
index 727d5cb6c91759dbbff770346299d526e67c1953..091555376a593d2937073a9b3789840dc8f3bb6d 100644
--- a/lib/dartdoc/mirrors/mirrors_util.dart
+++ b/lib/dartdoc/mirrors/mirrors_util.dart
@@ -14,11 +14,10 @@
* Returns an iterable over the type declarations directly inheriting from
* the declaration of this type.
*/
-Iterable<InterfaceMirror> computeSubdeclarations(MirrorSystem system,
- InterfaceMirror type) {
+Iterable<InterfaceMirror> computeSubdeclarations(InterfaceMirror type) {
type = type.declaration;
var subtypes = <InterfaceMirror>[];
- system.libraries().forEach((_, library) {
+ type.system.libraries().forEach((_, library) {
for (InterfaceMirror otherType in library.types().getValues()) {
var superClass = otherType.superclass();
if (superClass !== null) {
@@ -70,3 +69,13 @@ Mirror findMirror(Map<Object,Mirror> map, String name,
});
return foundMirror;
}
+
+LibraryMirror findLibrary(MemberMirror member) {
+ ObjectMirror owner = member.surroundingDeclaration();
+ if (owner is LibraryMirror) {
+ return owner;
+ } else if (owner is TypeMirror) {
+ return owner.library();
+ }
+ throw new Exception('Unexpected owner: ${owner}');
+}

Powered by Google App Engine
This is Rietveld 408576698