Re: Java strings vs. Javascript strings

2007-08-28 Thread Jason Johnston
On Tue, 28 Aug 2007 20:36:09 +0200, Grzegorz Kossakowski <[EMAIL PROTECTED]> wrote: >> FYI I personally would vote against making it the default, >> partly because I prefer the framework not do unexpected magic > conversions, >> but mostly because it's a backward-incompatible change and would break

Re: Java strings vs. Javascript strings

2007-08-28 Thread Grzegorz Kossakowski
Jason Johnston pisze: >> I'd like to suggest making it the default in Cocoon. >> Should I post an issue to JIRA or a message to the dev mailing list? > > I'd suggest bringing it up on the dev list to see if there is developer > support for it. Definitively. > FYI I personally would vote against

Re: Java strings vs. Javascript strings

2007-08-28 Thread Jason Johnston
On Tue, 28 Aug 2007 16:25:25 +0200, Tobia Conforto <[EMAIL PROTECTED]> wrote: >> Packages.org.mozilla.javascript.Context.getCurrentContext().getWrapFactory().setJavaPrimitiveWrap(false); > > Thank you! This is going to be a noticeable time saver for us, by > eliminating lots of small errors. Gre

Re: Java strings vs. Javascript strings

2007-08-28 Thread Tobia Conforto
Jason Johnston wrote: > So digging around in the Rhino API I discovered the WrapFactory > class[1], which is what Rhino uses to wrap Java objects returned from > methods so that they can be scripted. By default it wraps > java.lang.String objects just like it wraps any other Java object, > giving

Re: Java strings vs. Javascript strings

2007-08-27 Thread Jason Johnston
Tobia Conforto wrote: Jason Johnston wrote: Rhino also makes the JavaScript methods available to Java strings if the java.lang.String class doesn't already define them. For example: js> javaString.match(/a.*/) Thanks, that clears part of the confusion to me. It also explains why sometimes

Re: Java strings vs. Javascript strings

2007-08-27 Thread Tobia Conforto
Jason Johnston wrote: > Rhino also makes the JavaScript methods available to Java strings if > the java.lang.String class doesn't already define them. For example: > >js> javaString.match(/a.*/) Thanks, that clears part of the confusion to me. It also explains why sometimes I could get away w

Re: Java strings vs. Javascript strings

2007-08-27 Thread Jason Johnston
Tobia Conforto wrote: Hello Am I the only Cocoon user who is extremely annoyed by the fact that Java strings are not Javascript strings are not Java strings? ... Can't Rhino, or whatever piece of software is bridging Javascript to Java, do the Right Thing and present every string as a Javasc