You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stefano Mazzocchi <st...@apache.org> on 2004/09/16 00:35:43 UTC
Re: Rhino from mozilla.org and continuations
Igor Bukanov wrote:
> Hi!
>
> http://bugzilla.mozilla.org/show_bug.cgi?id=258844 contains a working
> patch against Rhino CVS from mozilla.org to enable Continuation support
> there.
>
> Note although the implementation is based on ideas from Christopher
> Oliver patch it is not a patch port.
>
> In particular, there is no support for catch (continue|break|return) but
> on the same time finally is respected, so the example from
> http://wiki.apache.org/cocoon/RhinoWithContinuations
>
> var pool = ...;
>
> function someFunction() {
>
> var conn = pool.getConnection();
> ...
>
> catch (break) {
> conn.close();
> conn = null;
> }
>
> catch (continue) {
> conn = pool.getConnection();
> }
> }
>
> with the patch would like:
>
> var pool = ...;
>
> function someFunction() {
>
> var conn = null;
> try {
> if (conn == null) {
> conn = pool.getConnection();
> }
> ...
> } finally {
> conn.close();
> conn = null;
> }
> }
>
> That is, if the control leaves "..." during continuation jump, then
> finally will be executed in the same way as it would be executed if ...
> contains return, throws exceptions etc.
>
> Another "differences" is that ContinuationException support for
> continuations across eval/Function.apply|call is not implemented yet.
>
> On the other hand Continuation usage is the same as with Christopher's
> patch including support for serialization so the last example from
> http://wiki.apache.org/cocoon/RhinoWithContinuations does work.
Igor, YOU ROCK!
Now, question: will this patch ever enter the main Rhino trunk? I'm sure
I speak for the whole community here when I say that we would like to
avoid having to distributed a forked version of rhino again because the
patch might become no longer applicable.
Anyway, thanks so much for this!
--
Stefano.
Re: Rhino from mozilla.org and continuations
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 16 sept. 04, à 01:02, Igor Bukanov a écrit :
> ...I think I will commit the patch early next week after I add few
> changes to Rhino documentation about it so it will be included in
> Rhino 1.6...
Big thanks for making this finally happen!
Just reading "Rhino from mozilla.org and continuations" gives that warm
fuzzy feeling ;-)
-Bertrand
Re: Rhino from mozilla.org and continuations
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Igor Bukanov wrote:
...
> I think I will commit the patch early next week after I add few changes
> to Rhino documentation about it so it will be included in Rhino 1.6.
http://www.textfiles.com/art/beer.vt
:-)
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
Re: Rhino from mozilla.org and continuations
Posted by Igor Bukanov <ml...@igor.fastmail.fm>.
Stefano Mazzocchi wrote:
...
> Now, question: will this patch ever enter the main Rhino trunk? I'm sure
> I speak for the whole community here when I say that we would like to
> avoid having to distributed a forked version of rhino again because the
> patch might become no longer applicable.
I think I will commit the patch early next week after I add few changes
to Rhino documentation about it so it will be included in Rhino 1.6.
Regards, Igor