cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: Switch behaviour changed in flowscript?
Date Fri, 11 Mar 2005 17:30:48 GMT
I've noticed strange behavior with switch too (using Cocoon
for me, I was able to get it to work by making sure the object being
tested is a JavaScript String, as opposed to a Java String, e.g.:

switch (String(shapeId)) {...

I realize that doesn't solve the inconsistency issue between versions,
but might help for your app in the short term.

On Fri, 2005-03-11 at 09:50 +0100, Bertrand Delacretaz wrote:
> This has been discussed on users@ already [1], just wanted to note it 
> here FYI.
> Specifically, flowscript code such as
> var shapeId = cocoon.request....
> switch (shapeId){
>          case "square":
> 	   // dosomething
> did not dosomething anymore when shapeId=="square", although it worked 
> in past releases (in the "shapes" sample of the tour block).
> I've changed it to if/else to be on the safe side (also in the trunk), 
> and in [1] Reinhard mentions that the new Rhino fixes this. Dunno since 
> when this is broken, but it might mean a small incompatibility between 
> 2.1.x releases.
> -Bertrand
> [1] 

View raw message