| 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:html library. | 6 // Auto-generated dart:html library. |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * HTML elements and other resources for web-based applications that need to | 9 * HTML elements and other resources for web-based applications that need to |
| 10 * interact with the browser and the DOM (Document Object Model). | 10 * interact with the browser and the DOM (Document Object Model). |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 // wrap_jso calls. | 363 // wrap_jso calls. |
| 364 bool __interop_checks = true; | 364 bool __interop_checks = true; |
| 365 | 365 |
| 366 /** Expando for JsObject, used by every Dart class associated with a Javascript | 366 /** Expando for JsObject, used by every Dart class associated with a Javascript |
| 367 * class (e.g., DOM, WebAudio, etc.). | 367 * class (e.g., DOM, WebAudio, etc.). |
| 368 */ | 368 */ |
| 369 | 369 |
| 370 /** | 370 /** |
| 371 * Return the JsObject associated with a Dart class [dartClass_instance]. | 371 * Return the JsObject associated with a Dart class [dartClass_instance]. |
| 372 */ | 372 */ |
| 373 unwrap_jso(dartClass_instance) { | 373 unwrap_jso(dartClass_instance) => js.unwrap_jso(dartClass_instance); |
| 374 try { | |
| 375 if (dartClass_instance != null) | |
| 376 return dartClass_instance is NativeFieldWrapperClass2 ? | |
| 377 dartClass_instance.blink_jsObject : dartClass_instance; | |
| 378 else | |
| 379 return null; | |
| 380 } catch(NoSuchMethodException) { | |
| 381 // No blink_jsObject then return the dartClass_instance is probably an | |
| 382 // array that was already converted to a Dart class e.g., Uint8ClampedList. | |
| 383 return dartClass_instance; | |
| 384 } | |
| 385 } | |
| 386 | 374 |
| 387 /** | 375 /** |
| 388 * Create Dart class that maps to the JS Type, add the JsObject as an expando | 376 * Create Dart class that maps to the JS Type, add the JsObject as an expando |
| 389 * on the Dart class and return the created Dart class. | 377 * on the Dart class and return the created Dart class. |
| 390 */ | 378 */ |
| 391 wrap_jso(jsObject) { | 379 wrap_jso(jsObject) { |
| 392 try { | 380 try { |
| 393 if (jsObject is! js.JsObject || jsObject == null) { | 381 if (jsObject is! js.JsObject || jsObject == null) { |
| 394 // JS Interop converted the object to a Dart class e.g., Uint8ClampedList. | 382 // JS Interop converted the object to a Dart class e.g., Uint8ClampedList. |
| 395 // or it's a simple type. | 383 // or it's a simple type. |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 final js.JsArray _basicList; | 552 final js.JsArray _basicList; |
| 565 | 553 |
| 566 operator [](int index) => wrap_jso(_basicList[index]); | 554 operator [](int index) => wrap_jso(_basicList[index]); |
| 567 | 555 |
| 568 operator []=(int index, value) => _basicList[index] = unwrap_jso(value); | 556 operator []=(int index, value) => _basicList[index] = unwrap_jso(value); |
| 569 | 557 |
| 570 int get length => _basicList.length; | 558 int get length => _basicList.length; |
| 571 int set length(int newLength) => _basicList.length = newLength; | 559 int set length(int newLength) => _basicList.length = newLength; |
| 572 } | 560 } |
| 573 | 561 |
| 562 /** |
| 563 * Upgrade the JS HTMLElement to the Dart class. Used by Dart's Polymer. |
| 564 */ |
| 565 createCustomUpgrader(Type customElementClass, $this) { |
| 566 var dartClass; |
| 567 try { |
| 568 dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this); |
| 569 } catch (e) { |
| 570 throw e; |
| 571 } finally { |
| 572 // Need to remember the Dart class that was created for this custom so |
| 573 // return it and setup the blink_jsObject to the $this that we'll be working |
| 574 // with as we talk to blink. |
| 575 $this['dart_class'] = dartClass; |
| 576 } |
| 577 |
| 578 return dartClass; |
| 579 } |
| 580 |
| 574 $else | 581 $else |
| 575 class JsoNativeFieldWrapper extends NativeFieldWrapperClass2 {} | 582 class JsoNativeFieldWrapper extends NativeFieldWrapperClass2 {} |
| 576 | 583 |
| 577 unwrap_jso(dartClass_instance) => dartClass_instance; | 584 unwrap_jso(dartClass_instance) => dartClass_instance; |
| 578 wrap_jso(jsObject) => jsObject; | 585 wrap_jso(jsObject) => jsObject; |
| 579 make_dart_rectangle(r) => r; | 586 make_dart_rectangle(r) => r; |
| 580 convertDartToNative_Dictionary(Map dict) => dict; | 587 convertDartToNative_Dictionary(Map dict) => dict; |
| 581 List convertDartToNative_StringArray(List<String> input) => input; | 588 List convertDartToNative_StringArray(List<String> input) => input; |
| 582 convertDartToNative_List(List input) => input; | 589 convertDartToNative_List(List input) => input; |
| 590 createCustomUpgrader(Type customElementClass, $this) => $this; |
| 583 | 591 |
| 584 $endif | 592 $endif |
| OLD | NEW |