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

Unified Diff: frog/lib/corelib_impl.dart

Issue 9431015: Wrote functions to convert collections and maps to strings and invoked (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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 | « frog/lib/collections.dart ('k') | frog/lib/frog_coreimpl_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/corelib_impl.dart
===================================================================
--- frog/lib/corelib_impl.dart (revision 4412)
+++ frog/lib/corelib_impl.dart (working copy)
@@ -7,6 +7,7 @@
#source("../../corelib/src/implementation/dual_pivot_quicksort.dart");
#source("../../corelib/src/implementation/duration_implementation.dart");
#source("../../corelib/src/implementation/exceptions.dart");
+#source("../../corelib/src/implementation/collections.dart");
#source("../../corelib/src/implementation/future_implementation.dart");
#source("../../corelib/src/implementation/hash_map_set.dart");
// TODO(jimhug): Re-explore tradeoffs with using builtin JS maps.
@@ -21,7 +22,6 @@
#source("string_base.dart");
#source("string_implementation.dart");
#source("arrays.dart");
-#source("collections.dart");
#source("date_implementation.dart");
#source("isolate.dart");
@@ -133,6 +133,8 @@
// Iterable<E> members:
Iterator<E> iterator() => new ListIterator(this);
+
+ String toString() => Collections.collectionToString(this);
}
// Iterator for lists.
@@ -226,15 +228,7 @@
throw const IllegalAccessException();
}
-
- // The base Array.prototype.toString does not like getting derived arrays,
- // so copy the array if needed.
- // TODO(jmesserly): this is not the right long term fix because it only works
- // for ImmutableList, but all derived types of ListFactory have this problem.
- // We need to implment ListFactory.toString in Dart. However, the
- // mplmentation needs correct handling of cycles (isolate tests depend on
- // this), so it's not trivial.
- String toString() => new List.from(this).toString();
+ String toString() => Collections.collectionToString(this);
}
@@ -289,6 +283,8 @@
V remove(K key) {
throw const IllegalAccessException();
}
+
+ String toString() => Maps.mapToString(this);
}
« no previous file with comments | « frog/lib/collections.dart ('k') | frog/lib/frog_coreimpl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698