ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 5738] New: - Error in <script> javascript exception handling
Date Tue, 08 Jan 2002 15:39:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5738>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5738

Error in <script> javascript exception handling

           Summary: Error in <script> javascript exception handling
           Product: Ant
           Version: 1.4
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: vojta@idoox.com


this code

<project name="pp" basedir=".." default="pokus">


  <target name="pokus">
    <script language="javascript"><![CDATA[

importClass(java.lang.Exception);

currentProject = pp;
_printecho = currentProject.createTask("echo");
function print(message) {
    _printecho.setMessage(message);
    _printecho.execute();
}

print("Before try");

try {
  print("in first try begin");

  try {
    print("second try");
  } catch(e) {
    print("second catch: " + e.toString());
  } finally {
    print("FINALLY");
    thow new Exception("EEeeee");
    print("FINALLY after throw");
  }

  print("in first try end");

} catch(e) {
  print("first catch: " + e.toString());
}

print("DONE");

]]></script>

  </target>

</project>


has output:

     [echo] Before try
     [echo] in first try begin
     [echo] second try
     [echo] FINALLY
     [echo] second catch: java.lang.Exception: EEeeee
     [echo] FINALLY
     [echo] first catch: java.lang.Exception: EEeeee
     [echo] DONE

but it should not catch exception in inner (second) catch and do FINALLY twice.
If I use only rhino it works fine but in Ant not.
I use rhino 1.5R2 , bsf 2.2 and java 1.3.0_01 on Linux. I think the problem is
in bsf because in Script.java is no way how to affect exception handling.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message