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 _ConsoleVariables { | 7 class _ConsoleVariables { |
8 Map<String, Object> _data = new Map<String, Object>(); | 8 Map<String, Object> _data = new Map<String, Object>(); |
9 | 9 |
10 /** | 10 /** |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (type == other) { | 97 if (type == other) { |
98 return true; | 98 return true; |
99 } | 99 } |
100 var superclass = reflectClass(type).superclass; | 100 var superclass = reflectClass(type).superclass; |
101 if (superclass != null) { | 101 if (superclass != null) { |
102 return isTypeSubclassOf(superclass.reflectedType, other); | 102 return isTypeSubclassOf(superclass.reflectedType, other); |
103 } | 103 } |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 static bool isTypeSubclassOfTag(Type type, String tagName) { | 107 static Element getAndValidateNativeType(Type type, String tagName) { |
108 var element = new Element.tag(tagName); | 108 var element = new Element.tag(tagName); |
109 return isTypeSubclassOf(type, element.runtimeType); | 109 if (!isTypeSubclassOf(type, element.runtimeType)) { |
| 110 return null; |
| 111 } |
| 112 return element; |
110 } | 113 } |
111 | 114 |
112 static window() native "Utils_window"; | 115 static window() native "Utils_window"; |
113 static forwardingPrint(String message) native "Utils_forwardingPrint"; | 116 static forwardingPrint(String message) native "Utils_forwardingPrint"; |
114 static int _getNewIsolateId() native "Utils_getNewIsolateId"; | 117 static int _getNewIsolateId() native "Utils_getNewIsolateId"; |
115 | 118 |
116 // The following methods were added for debugger integration to make working | 119 // The following methods were added for debugger integration to make working |
117 // with the Dart C mirrors API simpler. | 120 // with the Dart C mirrors API simpler. |
118 // TODO(jacobr): consider moving them to a separate library. | 121 // TODO(jacobr): consider moving them to a separate library. |
119 // If Dart supported dynamic code injection, we would only inject this code | 122 // If Dart supported dynamic code injection, we would only inject this code |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 _scheduleImmediateHelper._schedule(callback); | 574 _scheduleImmediateHelper._schedule(callback); |
572 }; | 575 }; |
573 | 576 |
574 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 577 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
575 throw new UnimplementedError("scheduleMicrotask in background isolates " | 578 throw new UnimplementedError("scheduleMicrotask in background isolates " |
576 "are not supported in the browser")); | 579 "are not supported in the browser")); |
577 | 580 |
578 void _initializeCustomElement(Element e) { | 581 void _initializeCustomElement(Element e) { |
579 _Utils.initializeCustomElement(e); | 582 _Utils.initializeCustomElement(e); |
580 } | 583 } |
OLD | NEW |