| 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 part of html; | 5 part of html; |
| 6 | 6 |
| 7 class _Utils { | 7 class _Utils { |
| 8 static List convertToList(List list) { | 8 static List convertToList(List list) { |
| 9 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. | 9 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. |
| 10 final length = list.length; | 10 final length = list.length; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 _NPObject.internal(); | 44 _NPObject.internal(); |
| 45 static _NPObject retrieve(String key) native "NPObject_retrieve"; | 45 static _NPObject retrieve(String key) native "NPObject_retrieve"; |
| 46 property(String propertyName) native "NPObject_property"; | 46 property(String propertyName) native "NPObject_property"; |
| 47 invoke(String methodName, [List args = null]) native "NPObject_invoke"; | 47 invoke(String methodName, [List args = null]) native "NPObject_invoke"; |
| 48 } | 48 } |
| 49 | 49 |
| 50 class _DOMWindowCrossFrame extends NativeFieldWrapperClass1 implements Window { | 50 class _DOMWindowCrossFrame extends NativeFieldWrapperClass1 implements Window { |
| 51 _DOMWindowCrossFrame.internal(); | 51 _DOMWindowCrossFrame.internal(); |
| 52 | 52 |
| 53 // Fields. | 53 // Fields. |
| 54 History get history() native "DOMWindow_history_cross_frame_Getter"; | 54 History get history native "DOMWindow_history_cross_frame_Getter"; |
| 55 Location get location() native "DOMWindow_location_cross_frame_Getter"; | 55 Location get location native "DOMWindow_location_cross_frame_Getter"; |
| 56 bool get closed() native "DOMWindow_closed_Getter"; | 56 bool get closed native "DOMWindow_closed_Getter"; |
| 57 int get length() native "DOMWindow_length_Getter"; | 57 int get length native "DOMWindow_length_Getter"; |
| 58 Window get opener() native "DOMWindow_opener_Getter"; | 58 Window get opener native "DOMWindow_opener_Getter"; |
| 59 Window get parent() native "DOMWindow_parent_Getter"; | 59 Window get parent native "DOMWindow_parent_Getter"; |
| 60 Window get top() native "DOMWindow_top_Getter"; | 60 Window get top native "DOMWindow_top_Getter"; |
| 61 | 61 |
| 62 // Methods. | 62 // Methods. |
| 63 void close() native "DOMWindow_close_Callback"; | 63 void close() native "DOMWindow_close_Callback"; |
| 64 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List
messagePorts]) native "DOMWindow_postMessage_Callback"; | 64 void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List
messagePorts]) native "DOMWindow_postMessage_Callback"; |
| 65 | 65 |
| 66 // Implementation support. | 66 // Implementation support. |
| 67 String get typeName => "DOMWindow"; | 67 String get typeName => "DOMWindow"; |
| 68 } | 68 } |
| 69 | 69 |
| 70 class _HistoryCrossFrame extends NativeFieldWrapperClass1 implements History { | 70 class _HistoryCrossFrame extends NativeFieldWrapperClass1 implements History { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool get isEmpty => Maps.isEmpty(this); | 106 bool get isEmpty => Maps.isEmpty(this); |
| 107 } | 107 } |
| 108 | 108 |
| 109 get _printClosure => (s) { | 109 get _printClosure => (s) { |
| 110 try { | 110 try { |
| 111 window.console.log(s); | 111 window.console.log(s); |
| 112 } catch (_) { | 112 } catch (_) { |
| 113 _Utils.print(s); | 113 _Utils.print(s); |
| 114 } | 114 } |
| 115 }; | 115 }; |
| OLD | NEW |