Sylvain Wallez wrote:
Igor Bukanov wrote:
It is hard to implement catch(continue|break|return) correctly. For example, what should happen if an exception is thrown during the execution of code there or what if continuation is captured/restored inside the catch block? Depending on the situation the version in Cocoon would either throw an exception or go into infinite loop. AFAICS respecting "finally" has rather simple answers in all those corner cases and that is why I put efforts to implement it rather the catch blocks.
For compatibility a special mode can be added in principle to Rhino from mozilla.org with support for arguments.continuation and catch(...) with the clear marks about deprecation (unless, of cause, it is possible to implement the constructions simply and efficiently - then no deprecation!). But my continuation curiosity does not spread far enough to create such patch.
"arguments.continuation", AFAIK was never documented publicly, so we can safely forget about it. For the special catch syntaxes, there will be some compatibility problems as many people are likely to have used it. But since the use of "finally" seems to allow the same kind of behaviour with a simpler syntax and a clearly specified semantics, I think it is our job, we cocooners, to prepare our user base to this change and give them directions to upgrade their scripts.
I think we should deprecate this syntax in the next Cocoon 2.1.x release and in Cocoon 2.2 we can use the new Rhino continuations implementation - this also gives us more time for testing.
-- Reinhard
