Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Side by Side Diff: sdk/lib/js/dartium/js_dartium.dart

Issue 1392723003: Switch dart:html objects not to be NativeFieldWrapper subclasses with JsInterop (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 * Support for interoperating with JavaScript. 6 * Support for interoperating with JavaScript.
7 * 7 *
8 * This library provides access to JavaScript objects from Dart, allowing 8 * This library provides access to JavaScript objects from Dart, allowing
9 * Dart code to get and set properties, and call methods of JavaScript objects 9 * Dart code to get and set properties, and call methods of JavaScript objects
10 * and invoke JavaScript functions. The library takes care of converting 10 * and invoke JavaScript functions. The library takes care of converting
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 void setDartHtmlWrapperFor(JsObject object, wrapper) { 726 void setDartHtmlWrapperFor(JsObject object, wrapper) {
727 object._dartHtmlWrapper = wrapper; 727 object._dartHtmlWrapper = wrapper;
728 } 728 }
729 729
730 /** 730 /**
731 * Used by callMethod to get the JS object for each argument passed if the 731 * Used by callMethod to get the JS object for each argument passed if the
732 * argument is a Dart class instance that delegates to a DOM object. See 732 * argument is a Dart class instance that delegates to a DOM object. See
733 * wrap_jso defined in dart:html. 733 * wrap_jso defined in dart:html.
734 */ 734 */
735 unwrap_jso(dartClass_instance) { 735 unwrap_jso(dartClass_instance) {
736 if (dartClass_instance is NativeFieldWrapperClass2 && dartClass_instance is! J sObject) 736 if (dartClass_instance is html.DartHtmlDomObject)
737 return dartClass_instance.blink_jsObject; 737 return dartClass_instance.blink_jsObject;
738 else 738 else
739 return dartClass_instance; 739 return dartClass_instance;
740 } 740 }
741 741
742 /** 742 /**
743 * Proxies a JavaScript object to Dart. 743 * Proxies a JavaScript object to Dart.
744 * 744 *
745 * The properties of the JavaScript object are accessible via the `[]` and 745 * The properties of the JavaScript object are accessible via the `[]` and
746 * `[]=` operators. Methods are callable via [callMethod]. 746 * `[]=` operators. Methods are callable via [callMethod].
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1174 return f; 1174 return f;
1175 } else { 1175 } else {
1176 var ret = _interopCaptureThisExpando[f]; 1176 var ret = _interopCaptureThisExpando[f];
1177 if (ret == null) { 1177 if (ret == null) {
1178 ret = new JsFunction.withThis(f); 1178 ret = new JsFunction.withThis(f);
1179 _interopCaptureThisExpando[f] = ret; 1179 _interopCaptureThisExpando[f] = ret;
1180 } 1180 }
1181 return ret; 1181 return ret;
1182 } 1182 }
1183 } 1183 }
OLDNEW
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | sdk/lib/svg/dartium/svg_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698