I tried the -ea flag (checkAssertions in the POM). It seems to be incompatible with the flag productionMode. I guess when production mode is true, assertions are disabled. I ended up with two test executions in my POM: "jsni-test" for keeping the type checked for legacy JSNI codes, and "normal-test" for JsInterop, running in production mode. It works fine.
On Mar 12, 2018 11:38, "Thomas Broyer" <t.broyer@gmail.com> wrote:
--
On Monday, March 12, 2018 at 9:17:58 AM UTC+1, Mincong Huang wrote:Thanks, Thomas. Changing to production mode fixed the problem.However, I noticed that when using production mode in tests, I cannot test the type-matching for JSNI anymore. Previously, the GWT generated interface code caught the problem at runtime in development mode. When running in production mode, we will not see an exception. JavaScript's dynamic typing obscures this kind of problem.public static native int badExample() /*-{ return "Not A Number"; }-*/;I'd suggest you use -ea and -draftCompile for your tests (checkAssertions and draftCompile in the POM). Hopefully that would catch more of such bugs… (-draftCompile will also speed them up)
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 .
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