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

Unified Diff: sdk/lib/collection/set.dart

Issue 297053002: Reinstall previous behavior for Set and Queue toString. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 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 | « sdk/lib/collection/queue.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/set.dart
diff --git a/sdk/lib/collection/set.dart b/sdk/lib/collection/set.dart
index a5febecc9d032837e5d94c41874d04fab8ac4468..906312adfed50af1f50d98ad0169f827638f010a 100644
--- a/sdk/lib/collection/set.dart
+++ b/sdk/lib/collection/set.dart
@@ -131,7 +131,7 @@ abstract class SetMixin<E> implements Set<E> {
return result;
}
- String toString() => _setToString(this);
+ String toString() => IterableBase.iterableToFullString(this, '{', '}');
// Copied from IterableMixin.
// Should be inherited if we had multi-level mixins.
@@ -298,4 +298,13 @@ abstract class SetMixin<E> implements Set<E> {
* `clear` in constant time. The default implementation works by removing every
* element.
*/
-abstract class SetBase<E> = Object with SetMixin<E>;
+abstract class SetBase<E> extends SetMixin<E> {
+ /**
+ * Convert a `Set` to a string as `{each, element, as, string}`.
+ *
+ * Handles circular references where converting one of the elements
+ * to a string ends up converting [set] to a string again.
+ */
+ static String setToString(Set set) =>
+ IterableBase.iterableToFullString(set, '{', '}');
+}
« no previous file with comments | « sdk/lib/collection/queue.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698