In order successfully translate into js and not cause gwtc to throw, the method signature has to be exactly the same - therefore the native code needs to be put in a private method that is called from isWhitespace.
On Jul 13, 10:54 am, AdrianBlakey <adrianbla...@gmail.com> wrote: > What's the best way to implement isWhitespace(char c)? > > It's not included in the GWT emulation. I read an earlier post that > advises writing a java regex but is this really sensible? It gets a > bit too involved and you need an emulation of CharBuffer since that's > all native code. > > Isn't it better to provide a js implementation like this? > > public static native boolean isWhitespace(char c) /*-{ > return /\s/.test(c); > > }-*/; > > Also, there is a huge "TODO" in the Character emulation code which > talks about deferred binding and Unicode database (eek), I wonder if > some of the missing emulation couldn't be provided by taking a more > simplistic approach along the lines above? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.