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

Unified Diff: tools/html_json_doc/lib/html_to_json.dart

Issue 11446053: Alphabetize json output. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Put thing back. Created 8 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 | « sdk/lib/html/docs/html_docs.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/html_json_doc/lib/html_to_json.dart
diff --git a/tools/html_json_doc/lib/html_to_json.dart b/tools/html_json_doc/lib/html_to_json.dart
index ddfb5eb2ef2a6fc7c7b6b10a63464e56ee489b5a..718cf94a6717a1f5f9111756e75c31af1ed167e7 100644
--- a/tools/html_json_doc/lib/html_to_json.dart
+++ b/tools/html_json_doc/lib/html_to_json.dart
@@ -299,8 +299,11 @@ String prettyPrintJson(Object json, [String indentation = '']) {
'$recursiveOutput'
'\n$indentation]';
} else if (json is Map) {
+ var keys = json.keys
+ ..sort();
+
// TODO(amouravski): No newline after :
- var mapList = json.keys.map((key) =>
+ var mapList = keys.map((key) =>
'$indentation${JSON.stringify(key)}:\n'
'${prettyPrintJson(json[key], '$indentation ')}');
var recursiveOutput = Strings.join(mapList, ',\n');
@@ -311,4 +314,4 @@ String prettyPrintJson(Object json, [String indentation = '']) {
output = '$indentation${JSON.stringify(json)}';
}
return output;
-}
+}
« no previous file with comments | « sdk/lib/html/docs/html_docs.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698