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

Side by Side Diff: client/dom/frog/dom_frog.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/dom/common/implementation.dart ('k') | client/html/src/CssClassSet.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #library('dom'); 1 #library('dom');
2 2
3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 3 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
4 // for details. All rights reserved. Use of this source code is governed by a 4 // for details. All rights reserved. Use of this source code is governed by a
5 // BSD-style license that can be found in the LICENSE file. 5 // BSD-style license that can be found in the LICENSE file.
6 6
7 // DO NOT EDIT 7 // DO NOT EDIT
8 // Auto-generated Dart DOM library. 8 // Auto-generated Dart DOM library.
9 9
10 10
(...skipping 12027 matching lines...) Expand 10 before | Expand all | Expand 10 after
12038 return false; 12038 return false;
12039 } 12039 }
12040 12040
12041 static bool every(Iterable<Object> iterable, bool f(Object o)) { 12041 static bool every(Iterable<Object> iterable, bool f(Object o)) {
12042 for (final e in iterable) { 12042 for (final e in iterable) {
12043 if (!f(e)) return false; 12043 if (!f(e)) return false;
12044 } 12044 }
12045 return true; 12045 return true;
12046 } 12046 }
12047 12047
12048 static List map(Iterable<Object> source,
12049 List<Object> destination,
12050 f(o)) {
12051 for (final e in source) {
12052 destination.add(f(e));
12053 }
12054 return destination;
12055 }
12056
12048 static List filter(Iterable<Object> source, 12057 static List filter(Iterable<Object> source,
12049 List<Object> destination, 12058 List<Object> destination,
12050 bool f(o)) { 12059 bool f(o)) {
12051 for (final e in source) { 12060 for (final e in source) {
12052 if (f(e)) destination.add(e); 12061 if (f(e)) destination.add(e);
12053 } 12062 }
12054 return destination; 12063 return destination;
12055 } 12064 }
12056 12065
12057 static bool isEmpty(Iterable<Object> iterable) { 12066 static bool isEmpty(Iterable<Object> iterable) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
12133 startIndex = a.length - 1; 12142 startIndex = a.length - 1;
12134 } 12143 }
12135 for (int i = startIndex; i >= 0; i--) { 12144 for (int i = startIndex; i >= 0; i--) {
12136 if (a[i] == element) { 12145 if (a[i] == element) {
12137 return i; 12146 return i;
12138 } 12147 }
12139 } 12148 }
12140 return -1; 12149 return -1;
12141 } 12150 }
12142 } 12151 }
OLDNEW
« no previous file with comments | « client/dom/common/implementation.dart ('k') | client/html/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698