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

Unified Diff: tools/dom/templates/immutable_list_mixin.darttemplate

Issue 11956039: Revert "Create IterableMixinWorkaround and move most of the Collections methods there." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/immutable_list_mixin.darttemplate
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate
index 7fb4cee84beb92514936de5492dcac804ae5859d..bf2bf4cc8e7e2708e9928adef5a974f1da0f46d6 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -15,54 +15,54 @@ $if DEFINE_LENGTH_AS_NUM_ITEMS
int get length => numberOfItems;
$endif
dynamic reduce(dynamic initialValue, dynamic combine(dynamic, $E)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ return Collections.reduce(this, initialValue, combine);
}
$if DEFINE_CONTAINS
- bool contains($E element) => IterableMixinWorkaround.contains(this, element);
+ bool contains($E element) => Collections.contains(this, element);
$else
// contains() defined by IDL.
$endif
- void forEach(void f($E element)) => IterableMixinWorkaround.forEach(this, f);
+ void forEach(void f($E element)) => Collections.forEach(this, f);
- String join([String separator]) => IterableMixinWorkaround.joinList(this, separator);
+ String join([String separator]) => Collections.joinList(this, separator);
- List mappedBy(f($E element)) => IterableMixinWorkaround.mappedByList(this, f);
+ List mappedBy(f($E element)) => new MappedList<$E, dynamic>(this, f);
- Iterable<$E> where(bool f($E element)) => IterableMixinWorkaround.where(this, f);
+ Iterable<$E> where(bool f($E element)) => new WhereIterable<$E>(this, f);
- bool every(bool f($E element)) => IterableMixinWorkaround.every(this, f);
+ bool every(bool f($E element)) => Collections.every(this, f);
- bool any(bool f($E element)) => IterableMixinWorkaround.any(this, f);
+ bool any(bool f($E element)) => Collections.any(this, f);
List<$E> toList() => new List<$E>.from(this);
Set<$E> toSet() => new Set<$E>.from(this);
bool get isEmpty => this.length == 0;
- List<$E> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ List<$E> take(int n) => new ListView<$E>(this, 0, n);
Iterable<$E> takeWhile(bool test($E value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
+ return new TakeWhileIterable<$E>(this, test);
}
- List<$E> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ List<$E> skip(int n) => new ListView<$E>(this, n, null);
Iterable<$E> skipWhile(bool test($E value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
+ return new SkipWhileIterable<$E>(this, test);
}
$E firstMatching(bool test($E value), { $E orElse() }) {
- return IterableMixinWorkaround.firstMatching(this, test, orElse);
+ return Collections.firstMatching(this, test, orElse);
}
$E lastMatching(bool test($E value), {$E orElse()}) {
- return IterableMixinWorkaround.lastMatchingInList(this, test, orElse);
+ return Collections.lastMatchingInList(this, test, orElse);
}
$E singleMatching(bool test($E value)) {
- return IterableMixinWorkaround.singleMatching(this, test);
+ return Collections.singleMatching(this, test);
}
$E elementAt(int index) {
@@ -126,9 +126,9 @@ $endif
throw new StateError("More than one element");
}
- $E min([int compare($E a, $E b)]) => IterableMixinWorkaround.min(this, compare);
+ $E min([int compare($E a, $E b)]) => Collections.min(this, compare);
- $E max([int compare($E a, $E b)]) => IterableMixinWorkaround.max(this, compare);
+ $E max([int compare($E a, $E b)]) => Collections.max(this, compare);
$E removeAt(int pos) {
throw new UnsupportedError("Cannot removeAt on immutable List.");
« no previous file with comments | « tools/dom/templates/html/impl/impl_Node.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698