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: utils/dartdoc/dartdoc.dart

Issue 9318013: Fix build break in dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review. Created 8 years, 11 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 | « no previous file | utils/dartdoc/files.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/dartdoc/dartdoc.dart
diff --git a/utils/dartdoc/dartdoc.dart b/utils/dartdoc/dartdoc.dart
index 56c941465158fd305a5b956d6a8c596e6bde664c..96a60e8cb2370a7736855c83670a7d0c3a6744d4 100644
--- a/utils/dartdoc/dartdoc.dart
+++ b/utils/dartdoc/dartdoc.dart
@@ -905,6 +905,7 @@ class Dartdoc {
/** Gets the URL for the documentation for [type]. */
String typeUrl(Type type) {
+ if (type.isTop) return '${sanitize(type.library.name)}.html';
// Always get the generic type to strip off any type parameters or
// arguments. If the type isn't generic, genericType returns `this`, so it
// works for non-generic types too.
@@ -913,7 +914,10 @@ class Dartdoc {
/** Gets the URL for the documentation for [member]. */
String memberUrl(Member member) {
- return '${typeUrl(member.declaringType)}#${member.name}';
+ final typeUrl = typeUrl(member.declaringType);
+ if (!member.isConstructor) return '$typeUrl#${member.name}';
+ if (member.constructorName == '') return '$typeUrl#new:${member.name}';
+ return '$typeUrl#new:${member.name}.${member.constructorName}';
}
/** Gets the anchor id for the document for [member]. */
« no previous file with comments | « no previous file | utils/dartdoc/files.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698