Monday, July 21, 2014

Re: GWT JS Interopt

On Wednesday, July 16, 2014 1:55:52 PM UTC+2, Eder Ignatowicz wrote:
Yep! Thanks for your help! :)

What does the trick is the flag -XjsInteropMode JS .

If anyone want to use my GWT JS interop demo is on https://github.com/ederign/gwt-playground.

Thanks for that; it helped me out a bit experimenting with jsinterop.

I had the hardest time getting the jsni functions (those simply returning $doc and $doc.body) to actually return anything other than null!  After playing with a bunch of options, I finally hit upon the problem.  I was using the maven gwt plugin (locally updated to use 2.7.0-SNAPSHOT of GWT) and one of the arguments it sends to the compiler is "-localWorkers" with a default of "8" (which comes from Runtime.getRuntime().availableProcessors() ).  The generated javascript functions contained "null.something" which clearly would not work.  But when I explicitly used "-localWorkers 1" instead, hurray, it worked perfectly!  Seems like some compiler bug to me. 

--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment