Revision: 4352
          http://vexi.svn.sourceforge.net/vexi/?rev=4352&view=rev
Author:   mkpg2
Date:     2012-02-07 10:16:10 +0000 (Tue, 07 Feb 2012)
Log Message:
-----------
Fix. Do not convert exception message to string.

Modified Paths:
--------------
    trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/Interpreter.jpp
    trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSExn.jpp
    
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/TestExceptions.java

Added Paths:
-----------
    
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/throw_object.js

Modified: trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/Interpreter.jpp
===================================================================
--- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/Interpreter.jpp  
2012-02-03 02:03:33 UTC (rev 4351)
+++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/Interpreter.jpp  
2012-02-07 10:16:10 UTC (rev 4352)
@@ -506,7 +506,7 @@
                        je.fillIfEmpty(this);
                        throw je;
                }else
-                       throw new JSExn(thrown, null, this);
+                       throw new JSExn(thrown, null, null, this);
             }
 
             case ADD_TRAP: case DEL_TRAP: {

Modified: trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSExn.jpp
===================================================================
--- trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSExn.jpp        
2012-02-03 02:03:33 UTC (rev 4351)
+++ trunk/org.vexi-library.js/src/main/jpp/org/ibex/js/JSExn.jpp        
2012-02-07 10:16:10 UTC (rev 4352)
@@ -13,12 +13,12 @@
     static public JS Constructor = new JS.Constructor("Exception") {
          public JS new_(JS[] args) throws JSExn { 
              JS msg =   args.length>=1?args[0]:null;
-             Throwable cause = null;
+             JSExn cause = null;
              if(args.length>=2 && args[1] instanceof ExnJSObj){
                  cause = ((ExnJSObj)args[1]).getJSExn();
              }
              JS type =  args.length>=3?args[2]:null;
-             JSExn r = new JSExn(JSU.toString(msg), type, cause);
+             JSExn r = new JSExn(msg, type, cause);
              return r.getObject();
          }
      };
@@ -48,16 +48,14 @@
     }
         
      
-    public JSExn(String msg, JS type, Throwable e) {
-        super(e);
-        this.js = new ExnJSObj(JSU.S(msg), type); 
-        fill(null);
-    }
+    public JSExn(String msg, JS type, Throwable cause) { this(JSU.S(msg), 
type, cause); }
     public JSExn(String msg, JS type){ this(JSU.S(msg), type); }
     public JSExn(String s) { this(JSU.S(s)); }
     public JSExn(JS msg) { this(msg,null); }
     public JSExn(JS msg, JS type) { this(msg,type,null); }
-    public JSExn(JS msg, JS type, Interpreter cx) { 
+    public JSExn(JS msg, JS type, Throwable cause) { this(msg, type, cause, 
null); }
+    public JSExn(JS msg, JS type, Throwable cause, Interpreter cx) { 
+        super(cause);
         this.js = new ExnJSObj(msg,type);
         fill(cx); 
     }

Modified: 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/TestExceptions.java
===================================================================
--- 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/TestExceptions.java
 2012-02-03 02:03:33 UTC (rev 4351)
+++ 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/TestExceptions.java
 2012-02-07 10:16:10 UTC (rev 4352)
@@ -15,7 +15,7 @@
     
     public static void main(String[] args) throws Throwable {
        JSTestSuite jts = new JSTestSuite(TestExceptions.class);
-       TestCase t = jts.createTestCase(jts.getResourceDirs(), "causes.js");
+       TestCase t = jts.createTestCase(jts.getResourceDirs(), 
"throw_object.js");
        t.runBare();
        }
 }

Added: 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/throw_object.js
===================================================================
--- 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/throw_object.js 
                            (rev 0)
+++ 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/throw_object.js 
    2012-02-07 10:16:10 UTC (rev 4352)
@@ -0,0 +1,9 @@
+//////
+// Test simple trap stuff
+var a = {b:1};
+try{
+    throw a;
+}catch(e){
+    assert(e.message["b"]==1);
+}
+


Property changes on: 
trunk/org.vexi-library.js/src/test/java/test/js/exec/exceptions/throw_object.js
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to