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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_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 | « samples/swarm/DataSource.dart ('k') | sdk/lib/collection/collections.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/js_array.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
index b925ded5d8e7303ffa183833711e21aecf145ef6..d7148a5981ce074417f3ec1534aa04d1508567b6 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_array.dart
@@ -34,7 +34,7 @@ class JSArray<E> implements List<E> {
}
Iterable<E> where(bool f(E element)) {
- return new WhereIterable<E>(this, f);
+ return IterableMixinWorkaround.where(this, f);
}
void addAll(Collection<E> collection) {
@@ -53,11 +53,11 @@ class JSArray<E> implements List<E> {
}
void forEach(void f(E element)) {
- return Collections.forEach(this, f);
+ return IterableMixinWorkaround.forEach(this, f);
}
List mappedBy(f(E element)) {
- return new MappedList(this, f);
+ return IterableMixinWorkaround.mappedByList(this, f);
}
String join([String separator]) {
@@ -70,35 +70,35 @@ class JSArray<E> implements List<E> {
}
List<E> take(int n) {
- return new ListView<E>(this, 0, n);
+ return IterableMixinWorkaround.takeList(this, n);
}
Iterable<E> takeWhile(bool test(E value)) {
- return new TakeWhileIterable<E>(this, test);
+ return IterableMixinWorkaround.takeWhile(this, test);
}
List<E> skip(int n) {
- return new ListView<E>(this, n, null);
+ return IterableMixinWorkaround.skipList(this, n);
}
Iterable<E> skipWhile(bool test(E value)) {
- return new SkipWhileIterable<E>(this, test);
+ return IterableMixinWorkaround.skipWhile(this, test);
}
reduce(initialValue, combine(previousValue, E element)) {
- return Collections.reduce(this, initialValue, combine);
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
E firstMatching(bool test(E value), {E orElse()}) {
- return Collections.firstMatching(this, test, orElse);
+ return IterableMixinWorkaround.firstMatching(this, test, orElse);
}
E lastMatching(bool test(E value), {E orElse()}) {
- return Collections.lastMatchingInList(this, test, orElse);
+ return IterableMixinWorkaround.lastMatchingInList(this, test, orElse);
}
E singleMatching(bool test(E value)) {
- return Collections.singleMatching(this, test);
+ return IterableMixinWorkaround.singleMatching(this, test);
}
E elementAt(int index) {
@@ -142,9 +142,9 @@ class JSArray<E> implements List<E> {
throw new StateError("More than one element");
}
- E min([int compare(E a, E b)]) => Collections.min(this, compare);
+ E min([int compare(E a, E b)]) => IterableMixinWorkaround.min(this, compare);
- E max([int compare(E a, E b)]) => Collections.max(this, compare);
+ E max([int compare(E a, E b)]) => IterableMixinWorkaround.max(this, compare);
void removeRange(int start, int length) {
checkGrowable(this, 'removeRange');
@@ -190,9 +190,9 @@ class JSArray<E> implements List<E> {
Arrays.copy(from, startFrom, this, start, length);
}
- bool any(bool f(E element)) => Collections.any(this, f);
+ bool any(bool f(E element)) => IterableMixinWorkaround.any(this, f);
- bool every(bool f(E element)) => Collections.every(this, f);
+ bool every(bool f(E element)) => IterableMixinWorkaround.every(this, f);
void sort([int compare(E a, E b)]) {
checkMutable(this, 'sort');
« no previous file with comments | « samples/swarm/DataSource.dart ('k') | sdk/lib/collection/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698