String is a special beast, as it's emulated by a JS String. It wouldn't
surprise me if that use case weren't supported. I grep'ed the source code
of GWT and didn't find any such use.
On Friday, February 15, 2013 11:53:58 AM UTC+1, alucard wrote:
>
> This does not work:
>
> private static native int test(String str) /*-{
> return [email protected]::compareTo(Ljava/lang/String;)("test");
> }-*/;
>
> It dies with the following exception:
>
> com.google.gwt.core.client.JavaScriptException: (Error)
> @test.client.Test::test(Ljava/lang/String;)([string: 'hello']): Error
> calling method on NPObject.
> at
> com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
> at
> com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
> at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
>
> Is it possible (if yes please write how) to invoke String methods from
> JSNI?
>
> Thanks for the help.
>
>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.