Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 59822 invoked from network); 15 Dec 2004 17:52:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Dec 2004 17:52:29 -0000 Received: (qmail 63549 invoked by uid 500); 15 Dec 2004 17:50:55 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 63252 invoked by uid 500); 15 Dec 2004 17:50: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 63116 invoked by uid 99); 15 Dec 2004 17:50:49 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from 10.21.96-84.rev.gaoland.net (HELO mail.anyware-tech.com) (84.96.21.10) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 15 Dec 2004 09:49:32 -0800 Received: from [10.0.0.27] (poukram.anyware [10.0.0.27]) by mail.anyware-tech.com (Postfix) with ESMTP id 4F8A15EBCC for ; Wed, 15 Dec 2004 18:22:35 +0100 (CET) Message-ID: <41C072B9.2080607@apache.org> Date: Wed, 15 Dec 2004 18:22:01 +0100 From: Sylvain Wallez Organization: Anyware Technologies User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: what happened to the global flow variables mapped to the session? References: <41C06CFB.4070007@apache.org> In-Reply-To: <41C06CFB.4070007@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Stefano Mazzocchi wrote: > I migrated an application that I wrote 18 months ago over to the > latest trunk and here are the incompatible things: > > 1) Rhino 1.6 is a lot more strict when you don't use "var" in front > of a variable declaration. The previous version of Rhino was more > tolerant. Not a problem but there is no back compatibility. This is not related to Rhino, but to the way we handle the global scope. JavaScript states that if an unknown variable is used, it is attached to the global scope if it's not declared with "var" and to the local scope otherwise. The problem is that both syntaxes (with and without "var) are correct, but lead to very different lifecycles of variables, especially when continuations are used. I added [1] this stricter behaviour after having spent half a day chasing a bug that was just a few "var" missing here and there in flowscript files. Several other people reported problems on the lists that were related to this implicit attachment of variables to the global scope. > 2) it used to be that in order to have global variable persist across > calls even without continuations, you called cocoon.createSession() > and the flow put those values in the session. Then it was removed and > done automatically. Now, I can't find a way to make it work. ??? I'm using this daily and it works fine ??? > So, is anybody able to persist global flow variables across > non-continuated flow executions? Well, that *should* work... Sylvain [1] http://marc.theaimsgroup.com/?t=109896790100003&r=1&w=2 -- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }