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

Unified Diff: pkg/docgen/lib/docgen.dart

Issue 99863003: Change the output of unnamed constructors in our files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index 0482da1e5f89481ec77fdaa27c615b2e7d9bb58c..7bfc4b9b50f7c2ecbfe5e6721ee6c627f34f0111 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -1502,9 +1502,13 @@ String docName(DeclarationMirror m) {
}
var owner = m.owner;
if (owner == null) return m.qualifiedName;
- // For the unnamed constructor we just return the class name.
- if (m.simpleName == '') return docName(owner);
- return docName(owner) + '.' + m.simpleName;
+ var simpleName = m.simpleName;
+ if (m is MethodMirror && m.isConstructor) {
+ // We name constructors specially -- including the class name again and a
+ // "-" to separate the constructor from its name (if any).
+ simpleName = '${owner.simpleName}-$simpleName';
+ }
+ return docName(owner) + '.' + simpleName;
}
/// Remove statics from the map of inherited items before adding them.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698