Chromium Code Reviews| Index: sdk/lib/collection/list.dart |
| diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart |
| index 5c81ae761efd5c7f9eceebfe1146765ae570ea22..3c4cee37556d1ac724629a39b18f7d816cf4aa0e 100644 |
| --- a/sdk/lib/collection/list.dart |
| +++ b/sdk/lib/collection/list.dart |
| @@ -28,6 +28,8 @@ typedef ListBase<E> = Object with ListMixin<E>; |
| * mixin to prevent all modifications. |
| */ |
| abstract class ListMixin<E> implements List<E> { |
| + static List _toStringList = new List(); |
| + |
| // Iterable interface. |
| Iterator<E> get iterator => new ListIterator<E>(this); |
| @@ -477,5 +479,14 @@ abstract class ListMixin<E> implements List<E> { |
| Iterable<E> get reversed => new ReversedListIterable(this); |
| - String toString() => ToString.iterableToString(this); |
| + String toString() { |
|
floitsch
2013/07/08 12:00:50
The ListMixin does not redirect to the Workaround
zarah
2013/07/08 14:35:15
Done.
|
| + 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; |
| + } |
| } |