| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 Window _convertNativeToDart_Window(win) { | 29 Window _convertNativeToDart_Window(win) { |
| 30 return _DOMWindowCrossFrameImpl._createSafe(win); | 30 return _DOMWindowCrossFrameImpl._createSafe(win); |
| 31 } | 31 } |
| 32 | 32 |
| 33 EventTarget _convertNativeToDart_EventTarget(e) { | 33 EventTarget _convertNativeToDart_EventTarget(e) { |
| 34 // Assume it's a Window if it contains the setInterval property. It may be | 34 // Assume it's a Window if it contains the setInterval property. It may be |
| 35 // from a different frame - without a patched prototype - so we cannot | 35 // from a different frame - without a patched prototype - so we cannot |
| 36 // rely on Dart type checking. | 36 // rely on Dart type checking. |
| 37 if (JS('bool', r'"setInterval" in #', e)) | 37 if (JS('bool', r'"setInterval" in #', e)) |
| 38 return _DOMWindowCrossFrameImpl._createSafe(event); | 38 return _DOMWindowCrossFrameImpl._createSafe(e); |
| 39 else | 39 else |
| 40 return e; | 40 return e; |
| 41 } | 41 } |
| 42 | 42 |
| 43 EventTarget _convertDartToNative_EventTarget(e) { | 43 EventTarget _convertDartToNative_EventTarget(e) { |
| 44 if (e is _DOMWindowCrossFrameImpl) { | 44 if (e is _DOMWindowCrossFrameImpl) { |
| 45 return e._window; | 45 return e._window; |
| 46 } else { | 46 } else { |
| 47 return e; | 47 return e; |
| 48 } | 48 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 } | 431 } |
| 432 | 432 |
| 433 | 433 |
| 434 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value); | 434 bool _isJavaScriptDate(value) => JS('bool', '# instanceof Date', value); |
| 435 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); | 435 bool _isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value); |
| 436 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); | 436 bool _isJavaScriptArray(value) => JS('bool', '# instanceof Array', value); |
| 437 bool _isJavaScriptSimpleObject(value) => | 437 bool _isJavaScriptSimpleObject(value) => |
| 438 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); | 438 JS('bool', 'Object.getPrototypeOf(#) === Object.prototype', value); |
| 439 bool _isImmutableJavaScriptArray(value) => | 439 bool _isImmutableJavaScriptArray(value) => |
| 440 JS('bool', r'!!(#.immutable$list)', value); | 440 JS('bool', r'!!(#.immutable$list)', value); |
| OLD | NEW |