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

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: Fixes and status-file update. 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 void removeRange(int start, int rangeLength) { 382 void removeRange(int start, int rangeLength) {
383 throw new UnsupportedError("Cannot removeRange on immutable List."); 383 throw new UnsupportedError("Cannot removeRange on immutable List.");
384 } 384 }
385 385
386 void insertRange(int start, int rangeLength, [Map initialValue]) { 386 void insertRange(int start, int rangeLength, [Map initialValue]) {
387 throw new UnsupportedError("Cannot insertRange on immutable List."); 387 throw new UnsupportedError("Cannot insertRange on immutable List.");
388 } 388 }
389 389
390 Iterable<Map> getRange(int start, int end) =>
391 IterableMixinWorkaround.getRangeList(this, start, end);
392
390 List<Map> sublist(int start, [int end]) { 393 List<Map> sublist(int start, [int end]) {
391 if (end == null) end = length; 394 if (end == null) end = length;
392 return Lists.getRange(this, start, end, <Map>[]); 395 return Lists.getRange(this, start, end, <Map>[]);
393 } 396 }
394 397
395 List<Map> getRange(int start, int rangeLength) =>
396 sublist(start, start + rangeLength);
397
398 Map<int, Map> asMap() => 398 Map<int, Map> asMap() =>
399 IterableMixinWorkaround.asMapList(this); 399 IterableMixinWorkaround.asMapList(this);
400 400
401 String toString() { 401 String toString() {
402 StringBuffer buffer = new StringBuffer('['); 402 StringBuffer buffer = new StringBuffer('[');
403 buffer.writeAll(this, ', '); 403 buffer.writeAll(this, ', ');
404 buffer.write(']'); 404 buffer.write(']');
405 return buffer.toString(); 405 return buffer.toString();
406 } 406 }
407 407
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // BSD-style license that can be found in the LICENSE file. 452 // BSD-style license that can be found in the LICENSE file.
453 453
454 454
455 @DocsEditable 455 @DocsEditable
456 @DomName('SQLTransactionSync') 456 @DomName('SQLTransactionSync')
457 @SupportedBrowser(SupportedBrowser.CHROME) 457 @SupportedBrowser(SupportedBrowser.CHROME)
458 @SupportedBrowser(SupportedBrowser.SAFARI) 458 @SupportedBrowser(SupportedBrowser.SAFARI)
459 @Experimental 459 @Experimental
460 abstract class _SQLTransactionSync native "*SQLTransactionSync" { 460 abstract class _SQLTransactionSync native "*SQLTransactionSync" {
461 } 461 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698