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

Unified Diff: pkg/docgen/lib/src/models/dummy_mirror.dart

Issue 245673002: pkg/docgen: a bunch of cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 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
« no previous file with comments | « pkg/docgen/lib/src/models/class.dart ('k') | pkg/docgen/lib/src/models/indexable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/models/dummy_mirror.dart
diff --git a/pkg/docgen/lib/src/models/dummy_mirror.dart b/pkg/docgen/lib/src/models/dummy_mirror.dart
index 0631a807a7903cb0cf0af8932e32645400d77581..9ad612a4804cdb36aaa1c8b829e65d1858bb5f6c 100644
--- a/pkg/docgen/lib/src/models/dummy_mirror.dart
+++ b/pkg/docgen/lib/src/models/dummy_mirror.dart
@@ -24,9 +24,8 @@ class DummyMirror implements Indexable {
DummyMirror(this.mirror, [this.owner]);
String get docName {
- if (mirror == null) return '';
if (mirror is LibraryMirror) {
- return dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-');
+ return getLibraryDocName(mirror);
}
var mirrorOwner = mirror.owner;
if (mirrorOwner == null) return dart2js_util.qualifiedNameOf(mirror);
@@ -40,7 +39,7 @@ class DummyMirror implements Indexable {
simpleName;
}
- bool get isPrivate => mirror == null ? false : mirror.isPrivate;
+ bool get isPrivate => mirror.isPrivate;
String get packageName {
var libMirror = _getOwningLibraryFromMirror(mirror);
@@ -53,13 +52,15 @@ class DummyMirror implements Indexable {
String get packagePrefix => packageName == null || packageName.isEmpty ?
'' : '$packageName/';
- LibraryMirror _getOwningLibraryFromMirror(DeclarationMirror mirror) {
- if (mirror is LibraryMirror) return mirror;
- if (mirror == null) return null;
- return _getOwningLibraryFromMirror(mirror.owner);
- }
-
+ // This is a known incomplete implementation of Indexable
+ // overriding noSuchMethod to remove static warnings
noSuchMethod(Invocation invocation) {
throw new UnimplementedError(invocation.memberName.toString());
}
}
+
+LibraryMirror _getOwningLibraryFromMirror(DeclarationMirror mirror) {
+ if (mirror == null) return null;
+ if (mirror is LibraryMirror) return mirror;
+ return _getOwningLibraryFromMirror(mirror.owner);
+}
« no previous file with comments | « pkg/docgen/lib/src/models/class.dart ('k') | pkg/docgen/lib/src/models/indexable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698