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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 13548002: Add Iterable.fold (and Stream.fold) which replace `reduce`. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/src/WrappedList.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 02f43e98ddaaef1c5f8f42149d3a57f0d74d1dc3..6d34148c72457c2b0e0d4ecf50f8053071d8dbe3 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -162,6 +162,11 @@ class _ChildrenElementList implements List {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
+ dynamic fold(dynamic initialValue,
+ dynamic combine(dynamic previousValue, Element element)) {
+ return IterableMixinWorkaround.fold(this, initialValue, combine);
+ }
+
void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
throw new UnimplementedError();
}
@@ -408,6 +413,11 @@ class _FrozenElementList implements List {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
+ dynamic fold(dynamic initialValue,
+ dynamic combine(dynamic previousValue, Element element)) {
+ return IterableMixinWorkaround.fold(this, initialValue, combine);
+ }
+
void setRange(int start, int rangeLength, List from, [int startFrom = 0]) {
throw new UnsupportedError('');
}
« no previous file with comments | « tools/dom/src/WrappedList.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698