| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 6 | 6 |
| 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 8 | 8 |
| 9 @DomName('IDBObjectStore.put') | 9 @DomName('IDBObjectStore.put') |
| 10 Future put(value, [key]) { | 10 Future put(value, [key]) { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 * // called when there are no more cursors. | 47 * // called when there are no more cursors. |
| 48 * print('all done!'); | 48 * print('all done!'); |
| 49 * }); | 49 * }); |
| 50 * | 50 * |
| 51 * Asynchronous operations which are not related to the current transaction | 51 * Asynchronous operations which are not related to the current transaction |
| 52 * will cause the transaction to automatically be committed-- all processing | 52 * will cause the transaction to automatically be committed-- all processing |
| 53 * must be done synchronously unless they are additional async requests to | 53 * must be done synchronously unless they are additional async requests to |
| 54 * the current transaction. | 54 * the current transaction. |
| 55 */ | 55 */ |
| 56 @DomName('IDBObjectStore.openCursor') | 56 @DomName('IDBObjectStore.openCursor') |
| 57 Stream<Cursor> openCursor({key, KeyRange range, String direction, | 57 Stream<CursorWithValue> openCursor({key, KeyRange range, String direction, |
| 58 bool autoAdvance}) { | 58 bool autoAdvance}) { |
| 59 var key_OR_range = null; | 59 var key_OR_range = null; |
| 60 if (key != null) { | 60 if (key != null) { |
| 61 if (range != null) { | 61 if (range != null) { |
| 62 throw new ArgumentError('Cannot specify both key and range.'); | 62 throw new ArgumentError('Cannot specify both key and range.'); |
| 63 } | 63 } |
| 64 key_OR_range = key; | 64 key_OR_range = key; |
| 65 } else { | 65 } else { |
| 66 key_OR_range = range; | 66 key_OR_range = range; |
| 67 } | 67 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } else { | 100 } else { |
| 101 controller.add(cursor); | 101 controller.add(cursor); |
| 102 if (autoAdvance == true) { | 102 if (autoAdvance == true) { |
| 103 cursor.next(); | 103 cursor.next(); |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 }); | 106 }); |
| 107 return controller.stream; | 107 return controller.stream; |
| 108 } | 108 } |
| 109 } | 109 } |
| OLD | NEW |