Author: [EMAIL PROTECTED]
Date: Tue Sep 16 14:34:31 2008
New Revision: 3653

Modified:
    changes/spoon/runAsync/user/src/com/google/gwt/core/client/GWT.java

Log:
By default, have GWT.runAsync() run the callback
with no questions asked.  This allows calling
runAsync in code that might or might not run
in a web browser.

Modified:  
changes/spoon/runAsync/user/src/com/google/gwt/core/client/GWT.java
==============================================================================
--- changes/spoon/runAsync/user/src/com/google/gwt/core/client/GWT.java  
(original)
+++ changes/spoon/runAsync/user/src/com/google/gwt/core/client/GWT.java Tue  
Sep 16 14:34:31 2008
@@ -193,20 +193,11 @@
     * Run the specified callback once the necessary code for it has been  
loaded.
     */
    public static void runAsync(RunAsyncCallback callback) {
-    if (sGWTBridge != null) {
-      // hosted mode; just call the callback
-      callback.onSuccess();
-    }
      /*
-     * In web mode, the compiler directly replaces calls to this method  
with a
-     * new Object() type expression of the correct rebound type.
+     * By default, just call the callback. This allows using  
<code>runAsync</code>
+     * in code that might or might not run in a web browser.
       */
-    throw new UnsupportedOperationException(
-        "ERROR: GWT.createAsync() is only usable in client code!  It  
cannot be called, "
-            + "for example, from server code.  If you are running a unit  
test, "
-            + "check that your test case extends GWTTestCase and that  
GWT.createAsync() "
-            + "is not called from within an initializer, constructor, or "
-            + "setUp()/tearDown().");
+    callback.onSuccess();
    }

    /**

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

Reply via email to