cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christofer.Dutz@univativ.de" <christofer.d...@univativ.de>
Subject AW: inner functions and continuations...
Date Thu, 19 Oct 2006 14:05:17 GMT
Hi Jörn,

Even if this might not help you, we use local functions just the way you initially wanted
to without any problems. Maybe it's a bug in the HEAD version?

Chris 

[ c h r i s t o f e r   d u t z ]

IT-Berater
univativ GmbH & Co. KG
Robert-Bosch-Str. 7, 64293 Darmstadt

fon: 0 61 51 / 66 717 - 21
fax: 0 61 51 / 66 717 - 29
email: christofer.dutz@univativ.de
http://www.univativ.de

Darmstadt, Stuttgart, Karlsruhe, Düsseldorf



-----Ursprüngliche Nachricht-----
Von: Jörn Nettingsmeier [mailto:nettings@apache.org] 
Gesendet: Montag, 16. Oktober 2006 00:01
An: users@cocoon.apache.org
Betreff: inner functions and continuations...

hi everyone!


i'm trying to add local functions to a flowscript in order to make it 
more maintainable.

the code looks like this:

      function executeUsecase() {

        var someLocalVar;

        function foo() {
          ...
        }

        foo();
        sendPageAndWait("/some/pipeline");
        foo();
      }


the second call to "foo" results in an error ("foo is undefined").
so it appears that those functions are not stored with the continuation. 
is this expected behaviour?

so i changed the function declaration to

        var foo = function() {
            ...
        }

it seems to work - the function is still available after the 
continuation. is this the correct approach?

for the record, i'm using cocoon 2.1 (svn HEAD) with sun java 1.5 on 
linux/x86_64.


regards,

jörn




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message