| 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 class _Utils { | 5 class _Utils { |
| 6 static List convertToList(List list) { | 6 static List convertToList(List list) { |
| 7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. | 7 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. |
| 8 final length = list.length; | 8 final length = list.length; |
| 9 List result = new List(length); | 9 List result = new List(length); |
| 10 result.setRange(0, length, list); | 10 result.setRange(0, length, list); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 | 47 |
| 48 class _DOMWindowCrossFrameImpl extends NativeFieldWrapperClass1 implements Windo
w { | 48 class _DOMWindowCrossFrameImpl extends NativeFieldWrapperClass1 implements Windo
w { |
| 49 _DOMWindowCrossFrameImpl(); | 49 _DOMWindowCrossFrameImpl(); |
| 50 | 50 |
| 51 // Fields. | 51 // Fields. |
| 52 History get history() native "DOMWindow_history_cross_frame_Getter"; | 52 History get history() native "DOMWindow_history_cross_frame_Getter"; |
| 53 Location get location() native "DOMWindow_location_cross_frame_Getter"; | 53 Location get location() native "DOMWindow_location_cross_frame_Getter"; |
| 54 bool get closed() native "DOMWindow_closed_Getter"; | 54 bool get closed() native "DOMWindow_closed_Getter"; |
| 55 int get length() native "DOMWindow_length_Getter"; | 55 int get length() native "DOMWindow_length_Getter"; |
| 56 DOMWindow get opener() native "DOMWindow_opener_Getter"; | 56 Window get opener() native "DOMWindow_opener_Getter"; |
| 57 DOMWindow get parent() native "DOMWindow_parent_Getter"; | 57 Window get parent() native "DOMWindow_parent_Getter"; |
| 58 DOMWindow get top() native "DOMWindow_top_Getter"; | 58 Window get top() native "DOMWindow_top_Getter"; |
| 59 | 59 |
| 60 // Methods. | 60 // Methods. |
| 61 void focus() native "DOMWindow_focus_Callback"; | 61 void focus() native "DOMWindow_focus_Callback"; |
| 62 void blur() native "DOMWindow_blur_Callback"; | 62 void blur() native "DOMWindow_blur_Callback"; |
| 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 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool isEmpty() => Maps.isEmpty(this); | 106 bool 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 } on Dynamic catch(_) { | 112 } on Dynamic catch(_) { |
| 113 _Utils.print(s); | 113 _Utils.print(s); |
| 114 } | 114 } |
| 115 }; | 115 }; |
| OLD | NEW |