cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörn Nettingsmeier <netti...@apache.org>
Subject inner functions and continuations...
Date Sat, 14 Oct 2006 13:22:12 GMT
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


Mime
View raw message