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

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

Issue 23534050: Make direct calls to _nativeIndexedGetter in "get last" "get first" "get single" instead of calling… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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') | tools/dom/scripts/htmldartgenerator.py » ('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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // -- start List<Map> mixins. 225 // -- start List<Map> mixins.
226 // Map is the element type. 226 // Map is the element type.
227 227
228 228
229 void set length(int value) { 229 void set length(int value) {
230 throw new UnsupportedError("Cannot resize immutable List."); 230 throw new UnsupportedError("Cannot resize immutable List.");
231 } 231 }
232 232
233 Map get first { 233 Map get first {
234 if (this.length > 0) { 234 if (this.length > 0) {
235 return this[0]; 235 return _nativeIndexedGetter(0);
236 } 236 }
237 throw new StateError("No elements"); 237 throw new StateError("No elements");
238 } 238 }
239 239
240 Map get last { 240 Map get last {
241 int len = this.length; 241 int len = this.length;
242 if (len > 0) { 242 if (len > 0) {
243 return this[len - 1]; 243 return _nativeIndexedGetter(len - 1);
244 } 244 }
245 throw new StateError("No elements"); 245 throw new StateError("No elements");
246 } 246 }
247 247
248 Map get single { 248 Map get single {
249 int len = this.length; 249 int len = this.length;
250 if (len == 1) { 250 if (len == 1) {
251 return this[0]; 251 return _nativeIndexedGetter(0);
252 } 252 }
253 if (len == 0) throw new StateError("No elements"); 253 if (len == 0) throw new StateError("No elements");
254 throw new StateError("More than one element"); 254 throw new StateError("More than one element");
255 } 255 }
256 256
257 Map elementAt(int index) => this[index]; 257 Map elementAt(int index) => this[index];
258 // -- end List<Map> mixins. 258 // -- end List<Map> mixins.
259 259
260 @DomName('SQLResultSetRowList.item') 260 @DomName('SQLResultSetRowList.item')
261 @DocsEditable() 261 @DocsEditable()
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 @DocsEditable() 293 @DocsEditable()
294 @DomName('SQLTransactionSync') 294 @DomName('SQLTransactionSync')
295 @SupportedBrowser(SupportedBrowser.CHROME) 295 @SupportedBrowser(SupportedBrowser.CHROME)
296 @SupportedBrowser(SupportedBrowser.SAFARI) 296 @SupportedBrowser(SupportedBrowser.SAFARI)
297 @Experimental() 297 @Experimental()
298 // http://www.w3.org/TR/webdatabase/#sqltransactionsync 298 // http://www.w3.org/TR/webdatabase/#sqltransactionsync
299 @Experimental() // deprecated 299 @Experimental() // deprecated
300 abstract class _SQLTransactionSync extends NativeFieldWrapperClass1 { 300 abstract class _SQLTransactionSync extends NativeFieldWrapperClass1 {
301 301
302 } 302 }
OLDNEW
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698