| 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 | 5 |
| 6 // Conversions for IDBKey. | 6 // Conversions for IDBKey. |
| 7 // | 7 // |
| 8 // Per http://www.w3.org/TR/IndexedDB/#key-construct | 8 // Per http://www.w3.org/TR/IndexedDB/#key-construct |
| 9 // | 9 // |
| 10 // "A value is said to be a valid key if it is one of the following types: Array | 10 // "A value is said to be a valid key if it is one of the following types: Array |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (e is File) { | 198 if (e is File) { |
| 199 throw const NotImplementedException('structured clone of File'); | 199 throw const NotImplementedException('structured clone of File'); |
| 200 } | 200 } |
| 201 | 201 |
| 202 if (e is _BlobImpl) return e; | 202 if (e is _BlobImpl) return e; |
| 203 if (e is Blob) { | 203 if (e is Blob) { |
| 204 throw const NotImplementedException('structured clone of Blob'); | 204 throw const NotImplementedException('structured clone of Blob'); |
| 205 } | 205 } |
| 206 | 206 |
| 207 if (e is _FileListImpl) return e; | 207 if (e is _FileListImpl) return e; |
| 208 if (e is FileList) { |
| 209 throw const NotImplementedException('structured clone of FileList'); |
| 210 } |
| 208 | 211 |
| 209 // TODO(sra): Firefox: How to convert _TypedImageData on the other end? | 212 // TODO(sra): Firefox: How to convert _TypedImageData on the other end? |
| 210 if (e is _ImageDataImpl) return e; | 213 if (e is _ImageDataImpl) return e; |
| 211 if (e is ImageData) { | 214 if (e is ImageData) { |
| 212 throw const NotImplementedException('structured clone of ImageData'); | 215 throw const NotImplementedException('structured clone of FileList'); |
| 213 } | 216 } |
| 214 | 217 |
| 215 if (e is _ArrayBufferImpl) return e; | 218 if (e is _ArrayBufferImpl) return e; |
| 216 if (e is ArrayBuffer) { | 219 if (e is ArrayBuffer) { |
| 217 throw const NotImplementedException('structured clone of ArrayBuffer'); | 220 throw const NotImplementedException('structured clone of ArrayBuffer'); |
| 218 } | 221 } |
| 219 | 222 |
| 220 if (e is _ArrayBufferViewImpl) return e; | 223 if (e is _ArrayBufferViewImpl) return e; |
| 221 if (e is ArrayBufferView) { | 224 if (e is ArrayBufferView) { |
| 222 throw const NotImplementedException('structured clone of ArrayBufferView')
; | 225 throw const NotImplementedException('structured clone of ArrayBufferView')
; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 388 } |
| 386 | 389 |
| 387 | 390 |
| 388 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value); | 391 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value); |
| 389 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); | 392 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); |
| 390 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); | 393 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); |
| 391 bool _isJavaScriptSimpleObject(value) => | 394 bool _isJavaScriptSimpleObject(value) => |
| 392 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); | 395 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); |
| 393 bool _isImmutableJavaScriptArray(value) => | 396 bool _isImmutableJavaScriptArray(value) => |
| 394 JS('bool', @'!!(#.immutable$list)', value); | 397 JS('bool', @'!!(#.immutable$list)', value); |
| OLD | NEW |