You aren't understanding the issue properly. The callback method you just 
mentioned is the onSuccess() method that you override. The issue is when 
that method is being called. In production the onSuccess() method is 
actually being "deferred" (the word I should have been using) until after 
the currently running JS has been completed. In dev mode the onSuccess() 
method is being called immediately, aka "inline" with the code that calls 
GWT.runAsync().

Try this code yourself if you don't believe me (note I wrote this code here 
and has not been checked for compilation errors... at the least it's missing 
the onFailure() method):

<code>
public void createAsyncPage(){
final String myString = null;

  GWT.runAsync(){
    public void onSuccess() {
      myString = "GWT is the best!";//this code is ran "later" in production, 
but runs immediately in dev mode
    }
  }
  myString.contains("GWT");//this should be a bug, this should result in a null 
pointer exception!
  //It will be null in production, but not in dev mode!
}

</code>

Someone has already responded to the GWT issue I created and has noted that 
this inconsistency has actually been documented in the GWT code with a TODO to 
fix it.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to