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

Unified Diff: client/html/src/NodeWrappingImplementation.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 | « client/html/src/ElementWrappingImplementation.dart ('k') | client/observable/observable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/src/NodeWrappingImplementation.dart
===================================================================
--- client/html/src/NodeWrappingImplementation.dart (revision 3161)
+++ client/html/src/NodeWrappingImplementation.dart (working copy)
@@ -25,6 +25,14 @@
void forEach(void f(Node element)) => _toList().forEach(f);
+ Collection map(f(Node element)) {
+ List output = new List();
+ forEach((Node element) {
+ output.add(f(element));
+ });
+ return output;
+ }
+
Collection<Node> filter(bool f(Node element)) {
List<Node> output = new List<Node>();
forEach((Node element) {
« no previous file with comments | « client/html/src/ElementWrappingImplementation.dart ('k') | client/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698