| OLD | NEW |
| 1 library dart.dom.indexed_db; | 1 library dart.dom.indexed_db; |
| 2 | 2 |
| 3 import 'dart:async'; | 3 import 'dart:async'; |
| 4 import 'dart:html'; | 4 import 'dart:html'; |
| 5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
| 6 import 'dart:typed_data'; | 6 import 'dart:typed_data'; |
| 7 import 'dart:_js_helper' show Creates, Returns, JSName, Null; | 7 import 'dart:_js_helper' show Creates, Returns, JSName, Null; |
| 8 import 'dart:_foreign_helper' show JS; | 8 import 'dart:_foreign_helper' show JS; |
| 9 import 'dart:_interceptors' show Interceptor, JSExtendableArray; | 9 import 'dart:_interceptors' show Interceptor, JSExtendableArray; |
| 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>, | 264 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>, |
| 265 // and copy to JavaScript array if necessary. | 265 // and copy to JavaScript array if necessary. |
| 266 | 266 |
| 267 // Try and create a transaction with a string mode. Browsers that expect a | 267 // Try and create a transaction with a string mode. Browsers that expect a |
| 268 // numeric mode tend to convert the string into a number. This fails | 268 // numeric mode tend to convert the string into a number. This fails |
| 269 // silently, resulting in zero ('readonly'). | 269 // silently, resulting in zero ('readonly'). |
| 270 return _transaction(storeName_OR_storeNames, mode); | 270 return _transaction(storeName_OR_storeNames, mode); |
| 271 } | 271 } |
| 272 | 272 |
| 273 Transaction transactionStore(String storeName, String mode) { | |
| 274 if (mode != 'readonly' && mode != 'readwrite') { | |
| 275 throw new ArgumentError(mode); | |
| 276 } | |
| 277 // Try and create a transaction with a string mode. Browsers that expect a | |
| 278 // numeric mode tend to convert the string into a number. This fails | |
| 279 // silently, resulting in zero ('readonly'). | |
| 280 return _transaction(storeName, mode); | |
| 281 } | |
| 282 | |
| 283 Transaction transactionList(List<String> storeNames, String mode) { | |
| 284 if (mode != 'readonly' && mode != 'readwrite') { | |
| 285 throw new ArgumentError(mode); | |
| 286 } | |
| 287 List storeNames_1 = convertDartToNative_StringArray(storeNames); | |
| 288 return _transaction(storeNames_1, mode); | |
| 289 } | |
| 290 | |
| 291 Transaction transactionStores(DomStringList storeNames, String mode) { | |
| 292 if (mode != 'readonly' && mode != 'readwrite') { | |
| 293 throw new ArgumentError(mode); | |
| 294 } | |
| 295 return _transaction(storeNames_1, mode); | |
| 296 } | |
| 297 | |
| 298 @JSName('transaction') | 273 @JSName('transaction') |
| 299 Transaction _transaction(stores, mode) native; | 274 Transaction _transaction(stores, mode) native; |
| 300 | 275 |
| 301 // To suppress missing implicit constructor warnings. | 276 // To suppress missing implicit constructor warnings. |
| 302 factory Database._() { throw new UnsupportedError("Not supported"); } | 277 factory Database._() { throw new UnsupportedError("Not supported"); } |
| 303 | 278 |
| 304 @DomName('IDBDatabase.abortEvent') | 279 @DomName('IDBDatabase.abortEvent') |
| 305 @DocsEditable() | 280 @DocsEditable() |
| 306 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); | 281 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider
<Event>('abort'); |
| 307 | 282 |
| (...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1285 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 1311 // for details. All rights reserved. Use of this source code is governed by a | 1286 // for details. All rights reserved. Use of this source code is governed by a |
| 1312 // BSD-style license that can be found in the LICENSE file. | 1287 // BSD-style license that can be found in the LICENSE file. |
| 1313 | 1288 |
| 1314 | 1289 |
| 1315 @DocsEditable() | 1290 @DocsEditable() |
| 1316 @DomName('IDBAny') | 1291 @DomName('IDBAny') |
| 1317 @deprecated // nonstandard | 1292 @deprecated // nonstandard |
| 1318 abstract class _IDBAny extends Interceptor native "IDBAny" { | 1293 abstract class _IDBAny extends Interceptor native "IDBAny" { |
| 1319 } | 1294 } |
| OLD | NEW |