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

Side by Side Diff: runtime/lib/typed_data.dart

Issue 18837002: Move toString() to collection classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/iterable.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // patch classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 patch class Int8List { 7 patch class Int8List {
8 /* patch */ factory Int8List(int length) { 8 /* patch */ factory Int8List(int length) {
9 return new _Int8Array(length); 9 return new _Int8Array(length);
10 } 10 }
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 return new _ByteDataView(buffer, offsetInBytes, length); 273 return new _ByteDataView(buffer, offsetInBytes, length);
274 } 274 }
275 } 275 }
276 276
277 277
278 // Based class for _TypedList that provides common methods for implementing 278 // Based class for _TypedList that provides common methods for implementing
279 // the collection and list interfaces. 279 // the collection and list interfaces.
280 280
281 abstract class _TypedListBase { 281 abstract class _TypedListBase {
282
282 // Method(s) implementing the Collection interface. 283 // Method(s) implementing the Collection interface.
283 bool contains(element) => IterableMixinWorkaround.contains(this, element); 284 bool contains(element) => IterableMixinWorkaround.contains(this, element);
284 285
285 void forEach(void f(num element)) { 286 void forEach(void f(num element)) {
286 var len = this.length; 287 var len = this.length;
287 for (var i = 0; i < len; i++) { 288 for (var i = 0; i < len; i++) {
288 f(this[i]); 289 f(this[i]);
289 } 290 }
290 } 291 }
291 292
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } 499 }
499 500
500 void fillRange(int start, int end, [num fillValue]) { 501 void fillRange(int start, int end, [num fillValue]) {
501 IterableMixinWorkaround.fillRangeList(this, start, end, fillValue); 502 IterableMixinWorkaround.fillRangeList(this, start, end, fillValue);
502 } 503 }
503 504
504 505
505 // Method(s) implementing Object interface. 506 // Method(s) implementing Object interface.
506 507
507 String toString() { 508 String toString() {
508 return ToString.iterableToString(this); 509 return IterableMixinWorkaround.toStringIterable(this, '[', ']');
509 } 510 }
510 511
511 512
512 // Internal utility methods. 513 // Internal utility methods.
513 514
514 bool _setRange(int start, int length, Iterable from, int startFrom) 515 bool _setRange(int start, int length, Iterable from, int startFrom)
515 native "TypedData_setRange"; 516 native "TypedData_setRange";
516 } 517 }
517 518
518 519
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 return value; 3107 return value;
3107 } 3108 }
3108 return object; 3109 return object;
3109 } 3110 }
3110 3111
3111 3112
3112 void _throwRangeError(int index, int length) { 3113 void _throwRangeError(int index, int length) {
3113 String message = "$index must be in the range [0..$length)"; 3114 String message = "$index must be in the range [0..$length)";
3114 throw new RangeError(message); 3115 throw new RangeError(message);
3115 } 3116 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.dart ('k') | sdk/lib/_collection_dev/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698