Chromium Code Reviews| Index: pkg/docgen/lib/src/models/library.dart |
| diff --git a/pkg/docgen/lib/src/models/library.dart b/pkg/docgen/lib/src/models/library.dart |
| index 996b129c199838dd865d0df540eae00126717fcb..826536fb1bfe86574e392c8774d3a4e22445c330 100644 |
| --- a/pkg/docgen/lib/src/models/library.dart |
| +++ b/pkg/docgen/lib/src/models/library.dart |
| @@ -38,6 +38,8 @@ class Library extends Indexable { |
| bool _hasBeenCheckedForPackage = false; |
| String packageIntro; |
| + Indexable get owner => const _LibraryOwner(); |
| + |
| Library get owningLibrary => this; |
| /// Returns the [Library] for the given [mirror] if it has already been |
| @@ -145,9 +147,7 @@ class Library extends Indexable { |
| String get name => docName; |
| - String get docName { |
| - return dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-'); |
| - } |
| + String get docName => getLibraryDocName(mirror); |
| /// Generates a map describing the [Library] object. |
| Map toMap() => { |
| @@ -171,3 +171,20 @@ class Library extends Indexable { |
| bool isValidMirror(DeclarationMirror mirror) => mirror is LibraryMirror; |
| } |
| + |
| +/// Dummy implementation of Indexable to represent the owner of a Library. |
|
kevmoo
2014/04/21 19:22:19
Only what is needed to answer requests to 'owner'
|
| +class _LibraryOwner implements Indexable { |
| + const _LibraryOwner(); |
| + |
| + String get docName => ''; |
| + |
| + bool get isPrivate => false; |
| + |
| + Indexable get owner => null; |
| + |
| + // This is a known incomplete implementation of Indexable |
| + // overriding noSuchMethod to remove static warnings |
| + noSuchMethod(Invocation invocation) { |
| + throw new UnimplementedError(invocation.memberName.toString()); |
| + } |
| +} |