Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 2568 invoked from network); 31 Mar 2009 16:34:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Mar 2009 16:34:51 -0000 Received: (qmail 75072 invoked by uid 500); 31 Mar 2009 16:34:50 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 75017 invoked by uid 500); 31 Mar 2009 16:34:50 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 75009 invoked by uid 99); 31 Mar 2009 16:34:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 16:34:50 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of jason@displayware.com does not designate 209.85.217.160 as permitted sender) Received: from [209.85.217.160] (HELO mail-gx0-f160.google.com) (209.85.217.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Mar 2009 16:34:44 +0000 Received: by gxk4 with SMTP id 4so3283457gxk.18 for ; Tue, 31 Mar 2009 09:34:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.5.15 with SMTP id 15mr5125596ane.50.1238517261741; Tue, 31 Mar 2009 09:34:21 -0700 (PDT) Date: Tue, 31 Mar 2009 09:34:21 -0700 Message-ID: <79e7600d0903310934p1b272ffyd1fb94ca84d54fa4@mail.gmail.com> Subject: Throwing from catch skips finally in Flowscript? From: Jason von Nieda To: users@cocoon.apache.org Content-Type: multipart/alternative; boundary=0016e645aacc6f3e1504666cc520 X-Virus-Checked: Checked by ClamAV on apache.org --0016e645aacc6f3e1504666cc520 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all, I ran into an issue yesterday that seems to be pretty serious and I'm having a hard time finding any information about it. In JavaScript Flowscript using Cocoon 2.1.11 and Rhino rhino1.5r4-continuations-R26.jar it seems that throwing an exception from within a catch block causes an associated finally block to fail to execute. Example: function test() { try { // this line runs Packages.java.lang.System.out.println("test1"); throw "moof"; } catch (e) { // this line runs Packages.java.lang.System.out.println("test2"); throw e; } finally { // this line does not Packages.java.lang.System.out.println("test3"); } } In the example above, if I remove the throw e; from the catch block the finally block runs fine. Additionally, if instead of using throw inside the catch I just run some code that causes an exception to be thrown, the finally also does not run. This seems fairly glaring to me, as it makes it impossible to use a catch and a finally at the same time. Can someone tell me if this is a known bug in Cocoon, or Rhino, or something else and if there is some information about it? I'm trying to decide how to proceed in fixing thousands of lines of Flow. Thanks, Jason von Nieda --0016e645aacc6f3e1504666cc520 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all, I ran into an issue yesterday that seems to be pretty serious and I= 'm having a hard time finding any information about it.

<= div>In JavaScript Flowscript using Cocoon 2.1.11 and Rhino=A0rhino1.5r4-con= tinuations-R26.jar it seems that throwing an exception from within a catch = block causes an associated finally block to fail to execute. Example:

function test()
{
try {
<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> // this li= ne runs
Pack= ages.java.lang.System.out.println("test1");
throw "moof&quo= t;;
}
cat= ch (e) {
// this line runs
Pack= ages.java.lang.System.out.println("test2");
throw e;
<= span class=3D"Apple-tab-span" style=3D"white-space:pre"> }
final= ly {
<= /span>// this line does not
Packages.java.lang.System.out.println("t= est3");
}
}

In the example above, if I remove the thr= ow e; from the catch block the finally block runs fine. Additionally, if in= stead of using throw inside the catch I just run some code that causes an e= xception to be thrown, the finally also does not run.=A0

This seems fairly glaring to me, as it makes it impossi= ble to use a catch and a finally at the same time.=A0

<= div>Can someone tell me if this is a known bug in Cocoon, or Rhino, or some= thing else and if there is some information about it? I'm trying to dec= ide how to proceed in fixing thousands of lines of Flow.

Thanks,
Jason von Nieda
--0016e645aacc6f3e1504666cc520--