Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 21465 invoked from network); 11 Mar 2005 17:31:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Mar 2005 17:31:55 -0000 Received: (qmail 1016 invoked by uid 500); 11 Mar 2005 17:31:52 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 944 invoked by uid 500); 11 Mar 2005 17:31:52 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 931 invoked by uid 99); 11 Mar 2005 17:31:52 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from ns1.sccx.com (HELO ns1.sccx.com) (209.108.197.61) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 11 Mar 2005 09:31:50 -0800 Subject: Re: Switch behaviour changed in flowscript? From: Jason Johnston To: dev@cocoon.apache.org In-Reply-To: <3df700b03ebda21065af58c7f660f1a5@codeconsult.ch> References: <3df700b03ebda21065af58c7f660f1a5@codeconsult.ch> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 11 Mar 2005 10:30:48 -0700 Message-Id: <1110562248.30647.7.camel@jjohnston> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-8) X-OriginalArrivalTime: 11 Mar 2005 17:31:48.0370 (UTC) FILETIME=[34284F20:01C52660] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I've noticed strange behavior with switch too (using Cocoon 2.1.5.1)... 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. --Jason 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] > http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=110865972811342&w=2 >