Revision: 1706
          http://svn.sourceforge.net/vexi/?rev=1706&view=rev
Author:   mkpg2
Date:     2007-03-05 00:52:21 -0800 (Mon, 05 Mar 2007)

Log Message:
-----------
Fix. Exceptions thrown during execution in a 'sub interpreters' 
(vexi usually corresponds to template apply, i.e. an implicit call that the 
calling interpreters code is not aware of)

Modified Paths:
--------------
    core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java
    core/trunk/org.ibex.js/src/org/ibex/js/Thread.java

Modified: core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java
===================================================================
--- core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java   2007-03-05 08:49:19 UTC 
(rev 1705)
+++ core/trunk/org.ibex.js/src/org/ibex/js/JSExn.java   2007-03-05 08:52:21 UTC 
(rev 1706)
@@ -32,8 +32,11 @@
     private void fill(Interpreter cx) {
         if(cx == null) cx = Thread.getCurrentInterpreter();
         if(cx == null) return;
-        addBacktrace(cx.f.sourceName + ":" + cx.f.line[cx.pc]);
-        cx.stack.backtrace(this);
+        while(cx!=null){
+               addBacktrace(cx.f.sourceName + ":" + cx.f.line[cx.pc]);
+               cx.stack.backtrace(this);
+               cx = cx.old;
+        }
     }
     public void printStackTrace() { printStackTrace(System.err); }
     public void printStackTrace(PrintStream ps) { printStackTrace(new 
PrintWriter(ps)); }

Modified: core/trunk/org.ibex.js/src/org/ibex/js/Thread.java
===================================================================
--- core/trunk/org.ibex.js/src/org/ibex/js/Thread.java  2007-03-05 08:49:19 UTC 
(rev 1705)
+++ core/trunk/org.ibex.js/src/org/ibex/js/Thread.java  2007-03-05 08:52:21 UTC 
(rev 1706)
@@ -103,6 +103,7 @@
                Interpreter old = current.currentInterpreter;
                // Always false. Restarting paused nested Interpreters not 
supported.
                current.currentInterpreter = new Interpreter((JSFunction) 
function,/*current.pauseable*/false, args);
+               current.currentInterpreter.old = old;
                try{
                        return (JS) current.currentInterpreter.run(null);
                }finally{       


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to