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

Unified Diff: lib/dartdoc/utils.dart

Issue 10068019: Fix ApiDoc to work with new dart:html code. Tweak dart:html generator to generate clearer @domName … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: lib/dartdoc/utils.dart
diff --git a/lib/dartdoc/utils.dart b/lib/dartdoc/utils.dart
index b8f7fbda5eddb256e9889166217c1f0d80f55652..b2e5758375bb9ca3feb3b83d7bbd78b94813220b 100644
--- a/lib/dartdoc/utils.dart
+++ b/lib/dartdoc/utils.dart
@@ -48,9 +48,14 @@ String unindent(String text, int indentation) {
/** Sorts the map by the key, doing a case-insensitive comparison. */
List orderByName(Map<String, Dynamic> map) {
- // TODO(rnystrom): it'd be nice to have this in corelib.
List keys = map.getKeys();
- keys.sort((x, y) => x.toUpperCase().compareTo(y.toUpperCase()));
+ keys.sort((a, b) {
+ // Hack: make sure $dom methods show up last in the list not first.
Bob Nystrom 2012/04/12 17:54:06 Take credit for it. :) // TODO(jacobr): ...
+ String transformName(String name) =>
+ name.toUpperCase().replaceFirst(const RegExp('\\\$DOM_'), 'zzzz');
+
+ return transformName(a).compareTo(transformName(b));
+ });
final values = [];
for (var k in keys) {
values.add(map[k]);

Powered by Google App Engine
This is Rietveld 408576698