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

Unified Diff: runtime/lib/typed_data.dart

Issue 18837002: Move toString() to collection classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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: runtime/lib/typed_data.dart
diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
index 04f6fa9b1229889a77989c35b0e30d7336d67f60..2f5fa53fe4e36e8e043174f262c7bab0889c04a3 100644
--- a/runtime/lib/typed_data.dart
+++ b/runtime/lib/typed_data.dart
@@ -279,6 +279,8 @@ patch class ByteData {
// the collection and list interfaces.
abstract class _TypedListBase {
+ static List _toStringList = new List();
+
// Method(s) implementing the Collection interface.
bool contains(element) => IterableMixinWorkaround.contains(this, element);
@@ -505,10 +507,16 @@ abstract class _TypedListBase {
// Method(s) implementing Object interface.
String toString() {
floitsch 2013/07/08 12:00:50 change to IterableMixinWorkaround.toStringList(thi
zarah 2013/07/08 14:35:15 Done.
- return ToString.iterableToString(this);
+ for(int i = 0; i < _toStringList.length; i++) {
+ if(identical(_toStringList[i], this))
+ return '[...]';
+ }
+ _toStringList.add(this);
+ String result = IterableMixinWorkaround.toStringList(this);
+ _toStringList.remove(this);
+ return result;
}
-
// Internal utility methods.
bool _setRange(int start, int length, Iterable from, int startFrom)

Powered by Google App Engine
This is Rietveld 408576698