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

Side by Side Diff: sdk/lib/web_sql/dart2js/web_sql_dart2js.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/svg/dartium/svg_dartium.dart ('k') | sdk/lib/web_sql/dartium/web_sql_dartium.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 /** 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } 375 }
376 376
377 void removeRange(int start, int rangeLength) { 377 void removeRange(int start, int rangeLength) {
378 throw new UnsupportedError("Cannot removeRange on immutable List."); 378 throw new UnsupportedError("Cannot removeRange on immutable List.");
379 } 379 }
380 380
381 void insertRange(int start, int rangeLength, [Map initialValue]) { 381 void insertRange(int start, int rangeLength, [Map initialValue]) {
382 throw new UnsupportedError("Cannot insertRange on immutable List."); 382 throw new UnsupportedError("Cannot insertRange on immutable List.");
383 } 383 }
384 384
385 Iterable<Map> getRange(int start, int end) =>
386 IterableMixinWorkaround.getRangeList(this, start, end);
387
385 List<Map> sublist(int start, [int end]) { 388 List<Map> sublist(int start, [int end]) {
386 if (end == null) end = length; 389 if (end == null) end = length;
387 return Lists.getRange(this, start, end, <Map>[]); 390 return Lists.getRange(this, start, end, <Map>[]);
388 } 391 }
389 392
390 List<Map> getRange(int start, int rangeLength) =>
391 sublist(start, start + rangeLength);
392
393 Map<int, Map> asMap() => 393 Map<int, Map> asMap() =>
394 IterableMixinWorkaround.asMapList(this); 394 IterableMixinWorkaround.asMapList(this);
395 395
396 String toString() { 396 String toString() {
397 StringBuffer buffer = new StringBuffer('['); 397 StringBuffer buffer = new StringBuffer('[');
398 buffer.writeAll(this, ', '); 398 buffer.writeAll(this, ', ');
399 buffer.write(']'); 399 buffer.write(']');
400 return buffer.toString(); 400 return buffer.toString();
401 } 401 }
402 402
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // BSD-style license that can be found in the LICENSE file. 447 // BSD-style license that can be found in the LICENSE file.
448 448
449 449
450 @DocsEditable 450 @DocsEditable
451 @DomName('SQLTransactionSync') 451 @DomName('SQLTransactionSync')
452 @SupportedBrowser(SupportedBrowser.CHROME) 452 @SupportedBrowser(SupportedBrowser.CHROME)
453 @SupportedBrowser(SupportedBrowser.SAFARI) 453 @SupportedBrowser(SupportedBrowser.SAFARI)
454 @Experimental 454 @Experimental
455 abstract class _SQLTransactionSync native "*SQLTransactionSync" { 455 abstract class _SQLTransactionSync native "*SQLTransactionSync" {
456 } 456 }
OLDNEW
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | sdk/lib/web_sql/dartium/web_sql_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698