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 _Property { | 7 class _Property { |
8 _Property(this.name) : | 8 _Property(this.name) : |
9 _hasValue = false, | 9 _hasValue = false, |
10 writable = false, | 10 writable = false, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 static DateTime doubleToDateTime(double dateTime) { | 117 static DateTime doubleToDateTime(double dateTime) { |
118 try { | 118 try { |
119 return new DateTime.fromMillisecondsSinceEpoch(dateTime.toInt()); | 119 return new DateTime.fromMillisecondsSinceEpoch(dateTime.toInt()); |
120 } catch(_) { | 120 } catch(_) { |
121 // TODO(antonnm): treat exceptions properly in bindings and | 121 // TODO(antonnm): treat exceptions properly in bindings and |
122 // find out how to treat NaNs. | 122 // find out how to treat NaNs. |
123 return null; | 123 return null; |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
| 127 static maybeUnwrapJso(obj) => unwrap_jso(obj); |
| 128 |
127 static List convertToList(List list) { | 129 static List convertToList(List list) { |
128 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. | 130 // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is
fine w/ it. |
129 final length = list.length; | 131 final length = list.length; |
130 List result = new List(length); | 132 List result = new List(length); |
131 result.setRange(0, length, list); | 133 result.setRange(0, length, list); |
132 return result; | 134 return result; |
133 } | 135 } |
134 | 136 |
135 static List convertMapToList(Map map) { | 137 static List convertMapToList(Map map) { |
136 List result = []; | 138 List result = []; |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 764 } |
763 | 765 |
764 /** | 766 /** |
765 * Helper to wrap the inspect method on InjectedScriptHost to provide the | 767 * Helper to wrap the inspect method on InjectedScriptHost to provide the |
766 * inspect method required for the | 768 * inspect method required for the |
767 */ | 769 */ |
768 static List consoleApi(host) { | 770 static List consoleApi(host) { |
769 return [ | 771 return [ |
770 "inspect", | 772 "inspect", |
771 (o) { | 773 (o) { |
772 host.inspect(o, null); | 774 host.callMethod("inspect", [o]); |
773 return o; | 775 return o; |
774 }, | 776 }, |
775 "dir", | 777 "dir", |
776 window().console.dir, | 778 window().console.dir, |
777 "dirxml", | 779 "dirxml", |
778 window().console.dirxml | 780 window().console.dirxml |
779 // FIXME: add copy method. | 781 // FIXME: add copy method. |
780 ]; | 782 ]; |
781 } | 783 } |
782 | 784 |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 _scheduleImmediateHelper._schedule(callback); | 1109 _scheduleImmediateHelper._schedule(callback); |
1108 }; | 1110 }; |
1109 | 1111 |
1110 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 1112 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
1111 throw new UnimplementedError("scheduleMicrotask in background isolates " | 1113 throw new UnimplementedError("scheduleMicrotask in background isolates " |
1112 "are not supported in the browser")); | 1114 "are not supported in the browser")); |
1113 | 1115 |
1114 // Class for unsupported native browser 'DOM' objects. | 1116 // Class for unsupported native browser 'DOM' objects. |
1115 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { | 1117 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { |
1116 } | 1118 } |
OLD | NEW |