Revision: 7101
Author: [email protected]
Date: Sat Nov 21 16:04:41 2009
Log: Add guards to make __gwt_disconnected more foolproof.
- Guards against double invocation.
- Performs inside a setTimeout.

Review by: jat (TBR)
http://code.google.com/p/google-web-toolkit/source/detail?r=7101

Modified:
  /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html

=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Sat  
Nov 21 16:04:31 2009
+++ /trunk/dev/core/src/com/google/gwt/core/ext/linker/impl/hosted.html Sat  
Nov 21 16:04:41 2009
@@ -147,6 +147,13 @@
  }

  function __gwt_disconnected() {
+  // Prevent double-invocation.
+  __gwt_disconnected = new Function();
+  // Do it in a timeout so we can be sure we have a clean stack.
+  window.setTimeout(__gwt_disconnected_impl, 1);
+}
+
+function __gwt_disconnected_impl() {
    var doc = window.top.document;
    var outer = doc.createElement("div");
    // Do not insert whitespace or outer.firstChild will get a text node.

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to