| 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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) { | 259 convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) { |
| 260 this.mustCopy = mustCopy; | 260 this.mustCopy = mustCopy; |
| 261 var copy = walk(object); | 261 var copy = walk(object); |
| 262 return copy; | 262 return copy; |
| 263 } | 263 } |
| 264 } | 264 } |
| 265 | 265 |
| 266 // Conversions for ContextAttributes. | 266 // Conversions for ContextAttributes. |
| 267 // | 267 // |
| 268 // On Firefox, the returned ContextAttributes is a plain object. | 268 // On Firefox, the returned ContextAttributes is a plain object. |
| 269 class _TypedContextAttributes { | 269 class ContextAttributes { |
| 270 bool alpha; | 270 bool alpha; |
| 271 bool antialias; | 271 bool antialias; |
| 272 bool depth; | 272 bool depth; |
| 273 bool premultipliedAlpha; | 273 bool premultipliedAlpha; |
| 274 bool preserveDrawingBuffer; | 274 bool preserveDrawingBuffer; |
| 275 bool stencil; | 275 bool stencil; |
| 276 bool failIfMajorPerformanceCaveat; | 276 bool failIfMajorPerformanceCaveat; |
| 277 | 277 |
| 278 _TypedContextAttributes(this.alpha, this.antialias, this.depth, | 278 ContextAttributes(this.alpha, this.antialias, this.depth, |
| 279 this.failIfMajorPerformanceCaveat, this.premultipliedAlpha, | 279 this.failIfMajorPerformanceCaveat, this.premultipliedAlpha, |
| 280 this.preserveDrawingBuffer, this.stencil); | 280 this.preserveDrawingBuffer, this.stencil); |
| 281 } | 281 } |
| 282 | 282 |
| 283 convertNativeToDart_ContextAttributes(nativeContextAttributes) { | 283 convertNativeToDart_ContextAttributes(nativeContextAttributes) { |
| 284 // On Firefox the above test fails because ContextAttributes is a plain | 284 // On Firefox the above test fails because ContextAttributes is a plain |
| 285 // object so we create a _TypedContextAttributes. | 285 // object so we create a _TypedContextAttributes. |
| 286 | 286 |
| 287 return new _TypedContextAttributes( | 287 return new ContextAttributes( |
| 288 JS('var', '#.alpha', nativeContextAttributes), | 288 JS('var', '#.alpha', nativeContextAttributes), |
| 289 JS('var', '#.antialias', nativeContextAttributes), | 289 JS('var', '#.antialias', nativeContextAttributes), |
| 290 JS('var', '#.depth', nativeContextAttributes), | 290 JS('var', '#.depth', nativeContextAttributes), |
| 291 JS('var', '#.failIfMajorPerformanceCaveat', nativeContextAttributes), | 291 JS('var', '#.failIfMajorPerformanceCaveat', nativeContextAttributes), |
| 292 JS('var', '#.premultipliedAlpha', nativeContextAttributes), | 292 JS('var', '#.premultipliedAlpha', nativeContextAttributes), |
| 293 JS('var', '#.preserveDrawingBuffer', nativeContextAttributes), | 293 JS('var', '#.preserveDrawingBuffer', nativeContextAttributes), |
| 294 JS('var', '#.stencil', nativeContextAttributes)); | 294 JS('var', '#.stencil', nativeContextAttributes)); |
| 295 } | 295 } |
| 296 | 296 |
| 297 // Conversions for ImageData | 297 // Conversions for ImageData |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 const String _serializedScriptValue = | 355 const String _serializedScriptValue = |
| 356 'num|String|bool|' | 356 'num|String|bool|' |
| 357 'JSExtendableArray|=Object|' | 357 'JSExtendableArray|=Object|' |
| 358 'Blob|File|NativeByteBuffer|NativeTypedData' | 358 'Blob|File|NativeByteBuffer|NativeTypedData' |
| 359 // TODO(sra): Add Date, RegExp. | 359 // TODO(sra): Add Date, RegExp. |
| 360 ; | 360 ; |
| 361 const annotation_Creates_SerializedScriptValue = | 361 const annotation_Creates_SerializedScriptValue = |
| 362 const Creates(_serializedScriptValue); | 362 const Creates(_serializedScriptValue); |
| 363 const annotation_Returns_SerializedScriptValue = | 363 const annotation_Returns_SerializedScriptValue = |
| 364 const Returns(_serializedScriptValue); | 364 const Returns(_serializedScriptValue); |
| OLD | NEW |