| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 } | 244 } |
| 245 | 245 |
| 246 function __dom_wrap_exception(e) { | 246 function __dom_wrap_exception(e) { |
| 247 return __dom_wrap(e); | 247 return __dom_wrap(e); |
| 248 } | 248 } |
| 249 | 249 |
| 250 function __dom_wrap_primitive(ptr) { | 250 function __dom_wrap_primitive(ptr) { |
| 251 return (ptr === null) ? (void 0) : ptr; | 251 return (ptr === null) ? (void 0) : ptr; |
| 252 } | 252 } |
| 253 | 253 |
| 254 | |
| 255 function __dom_finish_unwrap_function(fn, unwrapped) { | |
| 256 fn.$dom = unwrapped; | |
| 257 var isolatetoken = __dom_isolate_token(); | |
| 258 __dom_set_cached('dart_wrapper', unwrapped, isolatetoken, fn); | |
| 259 return unwrapped; | |
| 260 } | |
| 261 | |
| 262 /** @suppress {duplicate} */ | 254 /** @suppress {duplicate} */ |
| 263 function __dom_unwrap(obj) { | 255 function __dom_unwrap(obj, dropargs) { |
| 264 if (obj == null) { | 256 if (obj == null) { |
| 265 return (void 0); | 257 return (void 0); |
| 266 } | 258 } |
| 267 if (obj.$dom) { | 259 if (obj.$dom) { |
| 268 return obj.$dom; | 260 return obj.$dom; |
| 269 } | 261 } |
| 270 if (obj instanceof Function) { // BUGBUG: function from other IFrame | 262 if (obj instanceof Function) { // BUGBUG: function from other IFrame |
| 271 var unwrapped = function () { | 263 var isolatetoken = __dom_isolate_token(); |
| 272 var args = Array.prototype.slice.call(arguments); | 264 var unwrapped = __dom_get_cached('dart_unwrapped', obj, isolatetoken); |
| 273 return $dartcall(obj, args.map(__dom_wrap)); | 265 if (unwrapped) { |
| 266 return unwrapped; |
| 267 } |
| 268 var isolate = isolate$current; |
| 269 unwrapped = function () { |
| 270 var old = isolate$current; |
| 271 isolate$current = isolate; |
| 272 try { |
| 273 if (dropargs) { |
| 274 return $dartcall(obj, []); |
| 275 } else { |
| 276 var args = Array.prototype.slice.call(arguments); |
| 277 return $dartcall(obj, args.map(__dom_wrap)); |
| 278 } |
| 279 } finally { |
| 280 isolate$current = old; |
| 281 // TODO(vsm): This really needs to go elsewhere. |
| 282 isolate$runEventLoop(); |
| 283 } |
| 274 // BUGBUG? Should the result be unwrapped? Or is it always void/bool ? | 284 // BUGBUG? Should the result be unwrapped? Or is it always void/bool ? |
| 275 }; | 285 }; |
| 276 return __dom_finish_unwrap_function(obj, unwrapped); | 286 __dom_set_cached('dart_unwrapped', obj, isolatetoken, unwrapped); |
| 287 return unwrapped; |
| 277 } | 288 } |
| 278 return obj; | 289 return obj; |
| 279 } | 290 } |
| 280 | 291 |
| 281 function __dom_unwrap_TimeoutHandler_function(fn) { | 292 function __dom_unwrap_TimeoutHandler_function(fn) { |
| 282 // Some browsers (e.g. FF) pass data to the timeout function, others do not. | 293 // Some browsers (e.g. FF) pass data to the timeout function, others do not. |
| 283 // Dart's TimeoutHandler takes no arguments, so drop any arguments passed to | 294 // Dart's TimeoutHandler takes no arguments, so drop any arguments passed to |
| 284 // the unwrapped callback. | 295 // the unwrapped callback. |
| 285 return __dom_finish_unwrap_function( | 296 return __dom_unwrap(fn, true); |
| 286 fn, | |
| 287 function() { return $dartcall(fn, []); }); | |
| 288 } | 297 } |
| 289 | 298 |
| 290 // Declared in src/GlobalProperties.dart | 299 // Declared in src/GlobalProperties.dart |
| 291 function native__NativeDomGlobalProperties_getWindow() { | 300 function native__NativeDomGlobalProperties_getWindow() { |
| 292 // TODO: Should the window be obtained from an isolate? | 301 // TODO: Should the window be obtained from an isolate? |
| 293 return __dom_wrap(window); | 302 return __dom_wrap(window); |
| 294 } | 303 } |
| 295 | 304 |
| 296 // Declared in src/GlobalProperties.dart | 305 // Declared in src/GlobalProperties.dart |
| 297 function native__NativeDomGlobalProperties_getDocument() { | 306 function native__NativeDomGlobalProperties_getDocument() { |
| 298 // TODO: Should the window be obtained from an isolate? | 307 // TODO: Should the window be obtained from an isolate? |
| 299 return __dom_wrap(window.document); | 308 return __dom_wrap(window.document); |
| 300 } | 309 } |
| OLD | NEW |