more trap cleanup, properly handle JS.Clones
[org.ibex.core.git] / src / org / ibex / js / Test.java
index 8e4be33..478ef8e 100644 (file)
@@ -31,6 +31,7 @@ public class Test extends JS {
     public JS get(JS key) throws JSExn {
         if(!JS.isString(key)) return null;
         if("print".equals(JS.toString(key))) return METHOD;
+        if("clone".equals(JS.toString(key))) return METHOD;
         if("bgget".equals(JS.toString(key))) {
             action = "bgget";
             try {
@@ -51,8 +52,12 @@ public class Test extends JS {
             } catch(NotPauseableException e) {
                 throw new Error("should never happen");
             }
-        return;
-        }        
+            return;
+        }   
+        if("exit".equals(JS.toString(key))) {
+            System.exit(JS.toInt(val));
+            return;
+        }
         super.put(key,val);
     }
     
@@ -62,6 +67,7 @@ public class Test extends JS {
             System.out.println(JS.debugToString(a0));
             return null;
         }
+        if("clone".equals(JS.toString(method))) return a0 == null ? null : a0.jsclone();
         return null;
     }
 }