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

Unified Diff: runtime/lib/array.dart

Issue 18837002: Move toString() to collection classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. 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
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/growable_array.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index e7f88a3ddb70525e20e355a8f54c50925bee8165..fa8c6c6244ffdb06c9f3fa381e9dcb1205347bcb 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -6,17 +6,15 @@
// TODO(srdjan): Use shared array implementation.
class _ObjectArray<E> implements List<E> {
static final int _classId = (new _ObjectArray(0))._cid;
-
+
factory _ObjectArray(length) native "ObjectArray_allocate";
E operator [](int index) native "ObjectArray_getIndexed";
void operator []=(int index, E value) native "ObjectArray_setIndexed";
- String toString() {
- return ToString.iterableToString(this);
- }
-
+ String toString() => IterableMixinWorkaround.toStringList(this);
floitsch 2013/07/08 16:12:34 VM devs prefer not to use "=>".
zarah 2013/07/08 16:57:46 Done.
+
int get length native "ObjectArray_getLength";
void _copyFromObjectArray(_ObjectArray src,
@@ -456,9 +454,7 @@ class _ImmutableArray<E> implements List<E> {
"Cannot modify an immutable array");
}
- String toString() {
- return ToString.iterableToString(this);
- }
+ String toString() => IterableMixinWorkaround.toStringList(this);
floitsch 2013/07/08 16:12:34 ditto.
zarah 2013/07/08 16:57:46 Done.
int indexOf(Object element, [int start = 0]) {
return Arrays.indexOf(this, element, start, this.length);
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | runtime/lib/growable_array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698