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

Unified Diff: pkg/unittest/lib/src/pretty_print.dart

Issue 15350003: Fix unittest for dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/pretty_print.dart
diff --git a/pkg/unittest/lib/src/pretty_print.dart b/pkg/unittest/lib/src/pretty_print.dart
index 1608e108defc222ba69fb7ee3f080b1ee6259689..8534e868af4f39282fe95d64eb4e3689547bd563 100644
--- a/pkg/unittest/lib/src/pretty_print.dart
+++ b/pkg/unittest/lib/src/pretty_print.dart
@@ -48,9 +48,13 @@ String prettyPrint(object, {int maxLineLength, int maxItems}) {
return _indent(indent + 2) + string;
}).join(",\n") + "\n" + _indent(indent) + "]";
} else if (object is Map) {
+ // TODO(nweiz): This re-assignment is necessary to work around issue
+ // 10721. Remove it when that issue is fixed.
+ var map = object;
+
// Convert the contents of the map to string representations.
- var strings = object.keys.map((key) {
- return '${pp(key)}: ${pp(object[key])}';
+ var strings = map.keys.map((key) {
+ return '${pp(key)}: ${pp(map[key])}';
}).toList();
// Truncate the list of strings if it's longer than [maxItems].
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698