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

Side by Side Diff: sdk/lib/web_sql/dartium/web_sql_dartium.dart

Issue 14065011: Implement getRange (returning an Iterable). (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 void removeRange(int start, int rangeLength) { 395 void removeRange(int start, int rangeLength) {
396 throw new UnsupportedError("Cannot removeRange on immutable List."); 396 throw new UnsupportedError("Cannot removeRange on immutable List.");
397 } 397 }
398 398
399 void insertRange(int start, int rangeLength, [Map initialValue]) { 399 void insertRange(int start, int rangeLength, [Map initialValue]) {
400 throw new UnsupportedError("Cannot insertRange on immutable List."); 400 throw new UnsupportedError("Cannot insertRange on immutable List.");
401 } 401 }
402 402
403 Iterable<Map> getRange(int start, int end) =>
404 IterableMixinWorkaround.getRangeList(this, start, end);
405
403 List<Map> sublist(int start, [int end]) { 406 List<Map> sublist(int start, [int end]) {
404 if (end == null) end = length; 407 if (end == null) end = length;
405 return Lists.getRange(this, start, end, <Map>[]); 408 return Lists.getRange(this, start, end, <Map>[]);
406 } 409 }
407 410
408 List<Map> getRange(int start, int rangeLength) =>
409 sublist(start, start + rangeLength);
410
411 Map<int, Map> asMap() => 411 Map<int, Map> asMap() =>
412 IterableMixinWorkaround.asMapList(this); 412 IterableMixinWorkaround.asMapList(this);
413 413
414 String toString() { 414 String toString() {
415 StringBuffer buffer = new StringBuffer('['); 415 StringBuffer buffer = new StringBuffer('[');
416 buffer.writeAll(this, ', '); 416 buffer.writeAll(this, ', ');
417 buffer.write(']'); 417 buffer.write(']');
418 return buffer.toString(); 418 return buffer.toString();
419 } 419 }
420 420
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 @DocsEditable 471 @DocsEditable
472 @DomName('SQLTransactionSync') 472 @DomName('SQLTransactionSync')
473 @SupportedBrowser(SupportedBrowser.CHROME) 473 @SupportedBrowser(SupportedBrowser.CHROME)
474 @SupportedBrowser(SupportedBrowser.SAFARI) 474 @SupportedBrowser(SupportedBrowser.SAFARI)
475 @Experimental 475 @Experimental
476 abstract class _SQLTransactionSync extends NativeFieldWrapperClass1 { 476 abstract class _SQLTransactionSync extends NativeFieldWrapperClass1 {
477 _SQLTransactionSync.internal(); 477 _SQLTransactionSync.internal();
478 478
479 } 479 }
OLDNEW
« no previous file with comments | « sdk/lib/web_sql/dart2js/web_sql_dart2js.dart ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698