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

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

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 } 416 }
417 417
418 void removeRange(int start, int rangeLength) { 418 void removeRange(int start, int rangeLength) {
419 throw new UnsupportedError("Cannot removeRange on immutable List."); 419 throw new UnsupportedError("Cannot removeRange on immutable List.");
420 } 420 }
421 421
422 void insertRange(int start, int rangeLength, [Map initialValue]) { 422 void insertRange(int start, int rangeLength, [Map initialValue]) {
423 throw new UnsupportedError("Cannot insertRange on immutable List."); 423 throw new UnsupportedError("Cannot insertRange on immutable List.");
424 } 424 }
425 425
426 List<Map> sublist(int start, [int end]) {
427 if (end == null) end = length;
428 return Lists.getRange(this, start, end, <Map>[]);
429 }
430
426 List<Map> getRange(int start, int rangeLength) => 431 List<Map> getRange(int start, int rangeLength) =>
427 Lists.getRange(this, start, rangeLength, <Map>[]); 432 sublist(start, start + rangeLength);
428 433
429 Map<int, Map> asMap() => 434 Map<int, Map> asMap() =>
430 IterableMixinWorkaround.asMapList(this); 435 IterableMixinWorkaround.asMapList(this);
431 436
432 // -- end List<Map> mixins. 437 // -- end List<Map> mixins.
433 438
434 @DomName('SQLResultSetRowList.item') 439 @DomName('SQLResultSetRowList.item')
435 @DocsEditable 440 @DocsEditable
436 @Creates('=Object') 441 @Creates('=Object')
437 Map item(int index) { 442 Map item(int index) {
(...skipping 30 matching lines...) Expand all
468 @DomName('SQLTransactionSync') 473 @DomName('SQLTransactionSync')
469 @SupportedBrowser(SupportedBrowser.CHROME) 474 @SupportedBrowser(SupportedBrowser.CHROME)
470 @SupportedBrowser(SupportedBrowser.SAFARI) 475 @SupportedBrowser(SupportedBrowser.SAFARI)
471 @Experimental 476 @Experimental
472 class SqlTransactionSync native "*SQLTransactionSync" { 477 class SqlTransactionSync native "*SQLTransactionSync" {
473 478
474 @DomName('SQLTransactionSync.executeSql') 479 @DomName('SQLTransactionSync.executeSql')
475 @DocsEditable 480 @DocsEditable
476 SqlResultSet executeSql(String sqlStatement, List arguments) native; 481 SqlResultSet executeSql(String sqlStatement, List arguments) native;
477 } 482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698