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

Unified Diff: runtime/lib/growable_array.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/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index d58492e9a7ad69c608550593581e242bc25588b3..770dc15155f2c6413b507fb3d5c32de8bb71e0d8 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -4,6 +4,7 @@
class _GrowableObjectArray<T> implements List<T> {
static final int _classId = (new _GrowableObjectArray(0))._cid;
+ static List _toStringList = new List();
void insert(int index, T element) {
if (index < 0 || index > length) {
@@ -337,9 +338,16 @@ class _GrowableObjectArray<T> implements List<T> {
}
String toString() {
- return ToString.iterableToString(this);
+ for(int i = 0; i < _toStringList.length; i++) {
floitsch 2013/07/08 12:00:50 change to IterableMixinWorkaround.toStringList(thi
zarah 2013/07/08 14:35:15 Done.
+ if(identical(_toStringList[i], this))
+ return '[...]';
+ }
+ _toStringList.add(this);
+ String result = IterableMixinWorkaround.toStringList(this);
+ _toStringList.remove(this);
+ return result;
}
-
+
Iterator<T> get iterator {
return new ListIterator<T>(this);
}

Powered by Google App Engine
This is Rietveld 408576698