Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 12971 invoked from network); 1 Apr 2009 18:26:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 18:26:09 -0000 Received: (qmail 39104 invoked by uid 500); 1 Apr 2009 18:26:08 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 39011 invoked by uid 500); 1 Apr 2009 18:26:08 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 39003 invoked by uid 99); 1 Apr 2009 18:26:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 18:26:08 +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 74.125.44.153 as permitted sender) Received: from [74.125.44.153] (HELO yx-out-1718.google.com) (74.125.44.153) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 18:26:01 +0000 Received: by yx-out-1718.google.com with SMTP id 34so97633yxf.78 for ; Wed, 01 Apr 2009 11:25:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.120.14 with SMTP id s14mr4279051agc.58.1238610339076; Wed, 01 Apr 2009 11:25:39 -0700 (PDT) Date: Wed, 1 Apr 2009 11:25:39 -0700 Message-ID: <79e7600d0904011125s2fea0983s73b3f7e06bc709a8@mail.gmail.com> Subject: Throw inside catch skips finally in Flowscript? From: Jason von Nieda To: dev@cocoon.apache.org Content-Type: multipart/alternative; boundary=001636283794469b980466827103 X-Virus-Checked: Checked by ClamAV on apache.org --001636283794469b980466827103 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all, I ran into an issue 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 --001636283794469b980466827103 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi a= ll, I ran into an issue that seems to be pretty serious and I'm having = a hard time finding any information about it.

In JavaScr= ipt Flowscript using Cocoon 2.1.11 and Rhino=A0rhino1.5r4-continuations-R26= .jar it seems that throwing an exception from within a catch block causes a= n 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");
}<= /div>
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 b= lock the finally block runs fine. Additionally, if instead of using throw i= nside the catch I just run some code that causes an exception 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
--001636283794469b980466827103--