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

Side by Side Diff: sdk/lib/web_sql/dart2js/web_sql_dart2js.dart

Issue 14071002: Added new version of reduce. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed more uses of max, and a few bugs. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * An API for storing data in the browser that can be queried with SQL. 2 * An API for storing data in the browser that can be queried with SQL.
3 * 3 *
4 * **Caution:** this specification is no longer actively maintained by the Web 4 * **Caution:** this specification is no longer actively maintained by the Web
5 * Applications Working Group and may be removed at any time. 5 * Applications Working Group and may be removed at any time.
6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase /) 6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase /)
7 * for more information. 7 * for more information.
8 * 8 *
9 * The [dart:indexed_db] APIs is a recommended alternatives. 9 * The [dart:indexed_db] APIs is a recommended alternatives.
10 */ 10 */
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // From Iterable<Map>: 217 // From Iterable<Map>:
218 218
219 Iterator<Map> get iterator { 219 Iterator<Map> get iterator {
220 // Note: NodeLists are not fixed size. And most probably length shouldn't 220 // Note: NodeLists are not fixed size. And most probably length shouldn't
221 // be cached in both iterator _and_ forEach method. For now caching it 221 // be cached in both iterator _and_ forEach method. For now caching it
222 // for consistency. 222 // for consistency.
223 return new FixedSizeListIterator<Map>(this); 223 return new FixedSizeListIterator<Map>(this);
224 } 224 }
225 225
226 dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Map)) { 226 Map reduce(Map combine(Map value, Map element)) {
227 return IterableMixinWorkaround.reduce(this, initialValue, combine); 227 return IterableMixinWorkaround.reduce(this, combine);
228 } 228 }
229 229
230 dynamic fold(dynamic initialValue, dynamic combine(dynamic, Map)) { 230 dynamic fold(dynamic initialValue,
231 dynamic combine(dynamic previousValue, Map element)) {
231 return IterableMixinWorkaround.fold(this, initialValue, combine); 232 return IterableMixinWorkaround.fold(this, initialValue, combine);
232 } 233 }
233 234
234 bool contains(Map element) => IterableMixinWorkaround.contains(this, element); 235 bool contains(Map element) => IterableMixinWorkaround.contains(this, element);
235 236
236 void forEach(void f(Map element)) => IterableMixinWorkaround.forEach(this, f); 237 void forEach(void f(Map element)) => IterableMixinWorkaround.forEach(this, f);
237 238
238 String join([String separator = ""]) => 239 String join([String separator = ""]) =>
239 IterableMixinWorkaround.joinList(this, separator); 240 IterableMixinWorkaround.joinList(this, separator);
240 241
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (this.length > 0) return this[this.length - 1]; 331 if (this.length > 0) return this[this.length - 1];
331 throw new StateError("No elements"); 332 throw new StateError("No elements");
332 } 333 }
333 334
334 Map get single { 335 Map get single {
335 if (length == 1) return this[0]; 336 if (length == 1) return this[0];
336 if (length == 0) throw new StateError("No elements"); 337 if (length == 0) throw new StateError("No elements");
337 throw new StateError("More than one element"); 338 throw new StateError("More than one element");
338 } 339 }
339 340
340 Map min([int compare(Map a, Map b)]) =>
341 IterableMixinWorkaround.min(this, compare);
342
343 Map max([int compare(Map a, Map b)]) =>
344 IterableMixinWorkaround.max(this, compare);
345
346 void insert(int index, Map element) { 341 void insert(int index, Map element) {
347 throw new UnsupportedError("Cannot add to immutable List."); 342 throw new UnsupportedError("Cannot add to immutable List.");
348 } 343 }
349 344
350 Map removeAt(int pos) { 345 Map removeAt(int pos) {
351 throw new UnsupportedError("Cannot remove from immutable List."); 346 throw new UnsupportedError("Cannot remove from immutable List.");
352 } 347 }
353 348
354 Map removeLast() { 349 Map removeLast() {
355 throw new UnsupportedError("Cannot remove from immutable List."); 350 throw new UnsupportedError("Cannot remove from immutable List.");
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // BSD-style license that can be found in the LICENSE file. 447 // BSD-style license that can be found in the LICENSE file.
453 448
454 449
455 @DocsEditable 450 @DocsEditable
456 @DomName('SQLTransactionSync') 451 @DomName('SQLTransactionSync')
457 @SupportedBrowser(SupportedBrowser.CHROME) 452 @SupportedBrowser(SupportedBrowser.CHROME)
458 @SupportedBrowser(SupportedBrowser.SAFARI) 453 @SupportedBrowser(SupportedBrowser.SAFARI)
459 @Experimental 454 @Experimental
460 abstract class _SQLTransactionSync native "*SQLTransactionSync" { 455 abstract class _SQLTransactionSync native "*SQLTransactionSync" {
461 } 456 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698