Revision: 7676
Author: [email protected]
Date: Fri Mar  5 05:48:18 2010
Log: Fixes Issue 3608.  XMLHttpRequest now does "new $wnd.XMLHttpRequest"
rather than a bare "new XMLHttpRequest".  Also, it tolerates libraries
that install a non-function as $wnd.XMLHttpRequest on IE6.

http://code.google.com/p/google-web-toolkit/source/detail?r=7676

Modified:
 /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java

=======================================
--- /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java Mon Mar 1 06:45:55 2010 +++ /trunk/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java Fri Mar 5 05:48:18 2010
@@ -82,22 +82,14 @@
    */
   public static native XMLHttpRequest create() /*-{
     if ($wnd.XMLHttpRequest) {
+      return new XMLHttpRequest();
+    } else {
       try {
-        return new $wnd.XMLHttpRequest;
-      } catch(e) {
-        // Some third-party libraries define it but not as a function.
-        // See Issue 3608.
-        // Fall through to alternatives.
+        return new ActiveXObject('MSXML2.XMLHTTP.3.0');
+      } catch (e) {
+        return new ActiveXObject("Microsoft.XMLHTTP");
       }
     }
-
-    try {
-      // some IE6 installations can use this
-      return new ActiveXObject('MSXML2.XMLHTTP.3.0');
-    } catch (e) {
-      // other IE6 installations need this
-      return new ActiveXObject("Microsoft.XMLHTTP");
-    }
   }-*/;

   protected XMLHttpRequest() {

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

Reply via email to