Wednesday, August 23, 2017

Re: ClassCastException in generics



On Wednesday, August 23, 2017 at 3:02:08 PM UTC+2, Kirill Prazdnikov wrote:


Then my next question: 

if GWT generates checkckast as "yze_g$(fileBuffer_0_g$, $wnd.ArrayBuffer)",  where "$wnd.ArrayBuffer" is a type
how can I ask GWT to generate checkckast  to ArrayBuffer, not to $wnd.ArrayBuffer ?

In case you really need to reference a type in GWT's hidden iframe, then you can use namespace="<window>" instead of namespace=GLOBAL;

No, I want reference to a global type.

Terminology confusion here.
 
but this is undocumented behavior that could possibly change or break at any time.
Better fix you JSNI to use $wnd, or use JsInterop all the way down, with namespace=GLOBAL.

Why with namespace=GLOBAL  gwt generates checks that type is $wnd.ArrayBuffer ?

Because that's what GLOBAL means, which is what you want 99.9% of the time (except when you find a bug in Chrome that returns an object from the current browsing context rather than the one from the originating object)
 

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

No comments:

Post a Comment