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

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

Issue 13945009: Make default argument to Iterable.join be "". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 | « no previous file | runtime/lib/growable_array.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 5
6 // TODO(srdjan): Use shared array implementation. 6 // TODO(srdjan): Use shared array implementation.
7 class _ObjectArray<E> implements List<E> { 7 class _ObjectArray<E> implements List<E> {
8 8
9 factory _ObjectArray(length) native "ObjectArray_allocate"; 9 factory _ObjectArray(length) native "ObjectArray_allocate";
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Iterable interface. 99 // Iterable interface.
100 100
101 bool contains(E element) { 101 bool contains(E element) {
102 return IterableMixinWorkaround.contains(this, element); 102 return IterableMixinWorkaround.contains(this, element);
103 } 103 }
104 104
105 void forEach(f(E element)) { 105 void forEach(f(E element)) {
106 IterableMixinWorkaround.forEach(this, f); 106 IterableMixinWorkaround.forEach(this, f);
107 } 107 }
108 108
109 String join([String separator]) { 109 String join([String separator = ""]) {
110 return IterableMixinWorkaround.joinList(this, separator); 110 return IterableMixinWorkaround.joinList(this, separator);
111 } 111 }
112 112
113 Iterable map(f(E element)) { 113 Iterable map(f(E element)) {
114 return IterableMixinWorkaround.mapList(this, f); 114 return IterableMixinWorkaround.mapList(this, f);
115 } 115 }
116 116
117 reduce(initialValue, combine(previousValue, E element)) { 117 reduce(initialValue, combine(previousValue, E element)) {
118 return IterableMixinWorkaround.reduce(this, initialValue, combine); 118 return IterableMixinWorkaround.reduce(this, initialValue, combine);
119 } 119 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 351
352 void forEach(f(E element)) { 352 void forEach(f(E element)) {
353 IterableMixinWorkaround.forEach(this, f); 353 IterableMixinWorkaround.forEach(this, f);
354 } 354 }
355 355
356 Iterable map(f(E element)) { 356 Iterable map(f(E element)) {
357 return IterableMixinWorkaround.mapList(this, f); 357 return IterableMixinWorkaround.mapList(this, f);
358 } 358 }
359 359
360 String join([String separator]) { 360 String join([String separator = ""]) {
361 return IterableMixinWorkaround.joinList(this, separator); 361 return IterableMixinWorkaround.joinList(this, separator);
362 } 362 }
363 363
364 reduce(initialValue, combine(previousValue, E element)) { 364 reduce(initialValue, combine(previousValue, E element)) {
365 return IterableMixinWorkaround.reduce(this, initialValue, combine); 365 return IterableMixinWorkaround.reduce(this, initialValue, combine);
366 } 366 }
367 367
368 fold(initialValue, combine(previousValue, E element)) { 368 fold(initialValue, combine(previousValue, E element)) {
369 return IterableMixinWorkaround.fold(this, initialValue, combine); 369 return IterableMixinWorkaround.fold(this, initialValue, combine);
370 } 370 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 } 525 }
526 _position = _length; 526 _position = _length;
527 _current = null; 527 _current = null;
528 return false; 528 return false;
529 } 529 }
530 530
531 E get current { 531 E get current {
532 return _current; 532 return _current;
533 } 533 }
534 } 534 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698