I am not sure, but I somehow recall that the execution thread is not literally 
saved, but that the variables in the context are saved and restored and that 
the function is re-executed, but with a special flag that makes it jump to the 
position where the previous request left off..

So I think saving the function in a (local) variable is sensible.

Kind regards,
Geert

> 
   
 
Drs. G.P.H. Josten
Consultant
 
 

Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665  JZ  Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
www.daidalos.nl
KvK 27164984


De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.
 

> Van: Jörn Nettingsmeier [mailto:[EMAIL PROTECTED] 
> Verzonden: zaterdag 14 oktober 2006 15:22
> Aan: users@cocoon.apache.org
> Onderwerp: 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to