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 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated dart:svg library. | 6 // Auto-generated dart:svg library. |
7 | 7 |
8 library indexed_db; | 8 library indexed_db; |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 containsDate(object) { | 90 containsDate(object) { |
91 if (isJavaScriptDate(object)) return true; | 91 if (isJavaScriptDate(object)) return true; |
92 if (object is List) { | 92 if (object is List) { |
93 for (int i = 0; i < object.length; i++) { | 93 for (int i = 0; i < object.length; i++) { |
94 if (containsDate(object[i])) return true; | 94 if (containsDate(object[i])) return true; |
95 } | 95 } |
96 } | 96 } |
97 return false; // number, string. | 97 return false; // number, string. |
98 } | 98 } |
99 if (containsDate(nativeKey)) { | 99 if (containsDate(nativeKey)) { |
100 throw new UnimplementedError('Key containing Date'); | 100 throw new UnimplementedError('Key containing DateTime'); |
101 } | 101 } |
102 // TODO: Cache conversion somewhere? | 102 // TODO: Cache conversion somewhere? |
103 return nativeKey; | 103 return nativeKey; |
104 } | 104 } |
105 | 105 |
106 /** | 106 /** |
107 * Converts a Dart object into a valid IDBKey. | 107 * Converts a Dart object into a valid IDBKey. |
108 * | 108 * |
109 * May return the original input. Does not mutate input. | 109 * May return the original input. Does not mutate input. |
110 * | 110 * |
111 * If necessary, [dartKey] may be copied to ensure all lists are converted into | 111 * If necessary, [dartKey] may be copied to ensure all lists are converted into |
112 * JavaScript Arrays and Dart Dates into JavaScript Dates. | 112 * JavaScript Arrays and Dart Dates into JavaScript Dates. |
113 */ | 113 */ |
114 _convertDartToNative_IDBKey(dartKey) { | 114 _convertDartToNative_IDBKey(dartKey) { |
115 // TODO: Implement. | 115 // TODO: Implement. |
116 return dartKey; | 116 return dartKey; |
117 } | 117 } |
118 | 118 |
119 | 119 |
120 | 120 |
121 /// May modify original. If so, action is idempotent. | 121 /// May modify original. If so, action is idempotent. |
122 _convertNativeToDart_IDBAny(object) { | 122 _convertNativeToDart_IDBAny(object) { |
123 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); | 123 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); |
124 } | 124 } |
125 | 125 |
126 | 126 |
127 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add Date. | 127 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add DateTime. |
128 const _annotation_Creates_IDBKey = const Creates(_idbKey); | 128 const _annotation_Creates_IDBKey = const Creates(_idbKey); |
129 const _annotation_Returns_IDBKey = const Returns(_idbKey); | 129 const _annotation_Returns_IDBKey = const Returns(_idbKey); |
OLD | NEW |