Maybe GWT could warn when the JS accesses variables that are not "in scope" 
and not part of a whitelist of known globals (such as "window" or "$wnd"); 
that way, if 'i' was a global, you'd have to use 'window.i" to access it 
without a warning.

Worth suggesting this as an enhancement in the issue tracker or the 
gwt-contrib list.

On Sunday, September 14, 2014 1:26:16 AM UTC+2, Magnus wrote:
>
> Hi,
>
> when using embedded JS code, I found that I sometimes do not recognize 
> simple errors like this:
>
>
>  private native JavaScriptObject makeAnnotation (int x,int y,int as,char c)
>  /*-{
>
>   var pi = i * cs + cs / 2;
>
>  ...
>
>   return (i);
>  }-*/;
>
>
> In this case, variable i is not defined. But there is no compiler or 
> runtime error reported. It simply doesn't work and you get the (chrome) 
> browser message "paused in debugger". When you continue debugging, you find 
> yourself somewhere in exception handling code in Impl.java. Then, after 
> setting additional breakpoints, you fnally see, what's wrong.
>
> This process is time-consuming. How can you detect such simple errors 
> sooner?
>
> Thanks
> Magnus
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to