The string literal "Hello" is not a java.lang.String, it is a native JS String type. On JS native strings, "length" is a property, not a method, so "this.title.length" (without method invocation) should work.
Attila. On 2008.05.13., at 16:19, helge wrote: > Hi, > > another issue. As described in another mail I usually use an extended > JavaNativeObject with a Map as a script scope and this. Eg if the > script does > > this.title = "Hello"; > > 'title' is stored in a Java Map internally. I guess as a > java.lang.String, since it travels the bridge? > > Anyways, if I extract the String again, for example: > > var i = this.title.length() > > the methods are _all_ lost. (length will return 'undefined') > > Any ideas how this can happen? I guess String is special and some code > usually attaches JavaScript String methods and such, and doesn't get > called or is confused in my setup? (eg can't find the JS String > prototype or something?) > > Thanks, > Helge _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
