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

Unified Diff: runtime/lib/byte_array.dart

Issue 11971016: Create IterableMixinWorkaround and move most of the Collections methods there. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typo (mappedByList instead of mappedBy). Created 7 years, 11 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 | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/byte_array.dart
diff --git a/runtime/lib/byte_array.dart b/runtime/lib/byte_array.dart
index 6af5f2f4f3954397abb6a73a4e17c9bbf7cdd14c..8cfe0dd06acaf85ebf2bd71674ae0cc009b2816b 100644
--- a/runtime/lib/byte_array.dart
+++ b/runtime/lib/byte_array.dart
@@ -187,7 +187,7 @@ abstract class _ByteArrayBase {
// Methods implementing the Collection interface.
- bool contains(element) => Collections.contains(this, element);
+ bool contains(element) => IterableMixinWorkaround.contains(this, element);
void forEach(void f(element)) {
var len = this.length;
@@ -197,56 +197,56 @@ abstract class _ByteArrayBase {
}
List mappedBy(f(int element)) {
- return new MappedList<int, dynamic>(this, f);
+ return IterableMixinWorkaround.mappedByList(this, f);
}
String join([String separator]) {
- return Collections.join(this, separator);
+ return IterableMixinWorkaround.join(this, separator);
}
dynamic reduce(dynamic initialValue,
dynamic combine(dynamic initialValue, element)) {
- return Collections.reduce(this, initialValue, combine);
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
Collection where(bool f(element)) {
- return new WhereIterable<int>(this, f);
+ return IterableMixinWorkaround.where(this, f);
}
List<int> take(int n) {
- return new ListView<int>(this, 0, n);
+ return IterableMixinWorkaround.takeList(this, n);
}
Iterable<int> takeWhile(bool test(int value)) {
- return new TakeWhileIterable<int>(this, test);
+ return IterableMixinWorkaround.takeWhile(this, test);
}
List<int> skip(int n) {
- return new ListView<int>(this, n, null);
+ return IterableMixinWorkaround.skipList(this, n);
}
Iterable<int> skipWhile(bool test(int value)) {
- return new SkipWhileIterable<int>(this, test);
+ return IterableMixinWorkaround.skipWhile(this, test);
}
bool every(bool f(element)) {
- return Collections.every(this, f);
+ return IterableMixinWorkaround.every(this, f);
}
bool any(bool f(element)) {
- return Collections.any(this, f);
+ return IterableMixinWorkaround.any(this, f);
}
int firstMatching(bool test(int value), {int orElse()}) {
- return Collections.firstMatching(this, test, orElse);
+ return IterableMixinWorkaround.firstMatching(this, test, orElse);
}
int lastMatching(bool test(int value), {int orElse()}) {
- return Collections.lastMatchingInList(this, test, orElse);
+ return IterableMixinWorkaround.lastMatchingInList(this, test, orElse);
}
int singleMatching(bool test(int value)) {
- return Collections.singleMatching(this, test);
+ return IterableMixinWorkaround.singleMatching(this, test);
}
int elementAt(int index) {
@@ -323,9 +323,9 @@ abstract class _ByteArrayBase {
throw new StateError("More than one element");
}
- int min([int compare(int a, int b)]) => Collections.min(this, compare);
+ int min([int compare(int a, int b)]) => IterableMixinWorkaround.min(this, compare);
- int max([int compare(int a, int b)]) => Collections.max(this, compare);
+ int max([int compare(int a, int b)]) => IterableMixinWorkaround.max(this, compare);
void removeRange(int start, int length) {
throw new UnsupportedError(
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698