OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated Dart DOM implementation. | 6 // Auto-generated Dart DOM implementation. |
7 | 7 |
8 $!CODE | 8 $!CODE |
9 | 9 |
10 function __dom_native_TimeoutHander_method(_this, callback, timeout, operation)
{ | 10 function __dom_native_TimeoutHander_method(_this, callback, timeout, operation)
{ |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } catch (e) { | 167 } catch (e) { |
168 throw __dom_wrap_exception(e); | 168 throw __dom_wrap_exception(e); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 | 172 |
173 var __dom_type_map = { | 173 var __dom_type_map = { |
174 $!MAP | 174 $!MAP |
175 // Patches for non-WebKit browsers | 175 // Patches for non-WebKit browsers |
176 'Window': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImp
lementation, | 176 'Window': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImp
lementation, |
177 'global': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImp
lementation | 177 'global': native__DOMWindowWrappingImplementation_create__DOMWindowWrappingImp
lementation, |
| 178 'KeyEvent': native__KeyboardEventWrappingImplementation_create__KeyboardEventW
rappingImplementation, // Opera |
| 179 'HTMLPhraseElement': native__HTMLElementWrappingImplementation_create__HTMLEle
mentWrappingImplementation, // IE9 |
| 180 'MSStyleCSSProperties': native__CSSStyleDeclarationWrappingImplementation_crea
te__CSSStyleDeclarationWrappingImplementation // IE9 |
178 }; | 181 }; |
179 | 182 |
180 function __dom_get_class_chrome(ptr) { | 183 function __dom_get_class_chrome(ptr) { |
181 return __dom_type_map[ptr.constructor.name]; | 184 return __dom_type_map[ptr.constructor.name]; |
182 } | 185 } |
183 | 186 |
184 function __dom_get_class_generic(ptr) { | 187 function __dom_get_class_generic(ptr) { |
185 var isolatetoken = __dom_isolate_token(); | |
186 var result = __dom_get_cached('dart_class', ptr.__proto__, isolatetoken); | |
187 if (result) { | |
188 return result; | |
189 } | |
190 var str = Object.prototype.toString.call(ptr); | 188 var str = Object.prototype.toString.call(ptr); |
191 var name = str.substring(8, str.length - 1); | 189 var name = str.substring(8, str.length - 1); |
192 var cls = __dom_type_map[name]; | 190 var cls = __dom_type_map[name]; |
193 __dom_set_cached('dart_class', ptr.__proto__, isolatetoken, cls); | |
194 return cls; | 191 return cls; |
195 } | 192 } |
196 | 193 |
| 194 if (Object.__proto__) { |
| 195 __dom_get_class_generic = function(ptr) { |
| 196 var isolatetoken = __dom_isolate_token(); |
| 197 var result = __dom_get_cached('dart_class', ptr.__proto__, isolatetoken); |
| 198 if (result) { |
| 199 return result; |
| 200 } |
| 201 var str = Object.prototype.toString.call(ptr); |
| 202 var name = str.substring(8, str.length - 1); |
| 203 var cls = __dom_type_map[name]; |
| 204 __dom_set_cached('dart_class', ptr.__proto__, isolatetoken, cls); |
| 205 return cls; |
| 206 } |
| 207 } |
| 208 |
197 var __dom_get_class = __dom_get_class_generic; | 209 var __dom_get_class = __dom_get_class_generic; |
198 if (typeof window !== 'undefined' && // webworkers don't have a window | 210 if (typeof window !== 'undefined' && // webworkers don't have a window |
199 window.constructor.name == "DOMWindow") { | 211 window.constructor.name == "DOMWindow") { |
200 __dom_get_class = __dom_get_class_chrome; | 212 __dom_get_class = __dom_get_class_chrome; |
201 } | 213 } |
202 | 214 |
203 function __dom_get_cached(hashtablename, obj, isolatetoken) { | 215 function __dom_get_cached(hashtablename, obj, isolatetoken) { |
204 if (!obj.hasOwnProperty(hashtablename)) return (void 0); | 216 if (!obj.hasOwnProperty(hashtablename)) return (void 0); |
205 var hashtable = obj[hashtablename]; | 217 var hashtable = obj[hashtablename]; |
206 var hash = isolatetoken.hashCode; | 218 var hash = isolatetoken.hashCode; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 function native__NativeDomGlobalProperties_getWindow() { | 331 function native__NativeDomGlobalProperties_getWindow() { |
320 // TODO: Should the window be obtained from an isolate? | 332 // TODO: Should the window be obtained from an isolate? |
321 return __dom_wrap(window); | 333 return __dom_wrap(window); |
322 } | 334 } |
323 | 335 |
324 // Declared in src/GlobalProperties.dart | 336 // Declared in src/GlobalProperties.dart |
325 function native__NativeDomGlobalProperties_getDocument() { | 337 function native__NativeDomGlobalProperties_getDocument() { |
326 // TODO: Should the window be obtained from an isolate? | 338 // TODO: Should the window be obtained from an isolate? |
327 return __dom_wrap(window.document); | 339 return __dom_wrap(window.document); |
328 } | 340 } |
OLD | NEW |