cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <>
Subject Local variables in FlowScript
Date Tue, 20 Jan 2004 13:00:30 GMT
Hi all,

I think I'm missing something... But according to my observations, 
continuations are not capturing current state of the local variables. 
Consider following snippet:

function test() {
    var k = [];
    for (var i = 0; i < 5; i++) {
        k[i] = capture();
        if (k[i] == undefined) {
            cocoon.log.debug("Continuation resumed; i = " + i);


function capture() {
    return new Continuation();

Once executed, you might expect that it will print "Continuation 
resumed; i = 2". But instead, it prints "Continuation resumed; i = 5", 
which is last state of the local variable "i", not the state the 
variable had when continuation was captured. I guess continuation only 

The issue described above, combined with woody forms, makes wizards 
impossible - you can't get to the previous wizard page, as position will 
always point to the last visited page, instead of the page of the 
continuation. Any suggestions?

Another issue is that documentation [1], "Features" -> "Continuations" 
implies that state of local variables is captured. And chapter 
"Controlling what gets captured in a Continuation" does not suggest a 
way how to control what is captured in a continuation (i.e., how to 
indicate what should be captured).... :-/



View raw message