Looks reasonable, but the GWT team will want to probe this at the margins (is it consistent with Java? does it need to be?).
FWIW, the open issue for this is: http://code.google.com/p/google-web-toolkit/issues/detail?id=1983 Definitions of isWhitespace(): http://en.wikipedia.org/wiki/Whitespace_character#Unicode http://download.java.net/jdk7/docs/api/java/lang/Character.html#isWhitespace(char) http://download.java.net/jdk7/docs/api/java/lang/Character.html#isWhitespace(int) http://blog.stevenlevithan.com/archives/javascript-regex-and-unicode On Jul 13, 10:54 am, AdrianBlakey <[email protected]> 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
