cleaned up trap handling in Interpreter.java
[org.ibex.core.git] / src / org / ibex / js / JS.java
index 1e38ce5..65f624e 100644 (file)
@@ -10,14 +10,15 @@ public class JS extends org.ibex.util.BalancedTree {
 
     public static boolean checkAssertions = false;
 
-    public static final Object METHOD = new Object();
+    public static final Object METHOD = new Object() { public String toString() { return "JS.METHOD"; } };
     public final JS unclone() { return _unclone(); }
     public Enumeration keys() throws JSExn { return entries == null ? emptyEnumeration : entries.keys(); }
     public Object get(Object key) throws JSExn { return entries == null ? null : entries.get(key, null); }
     public void put(Object key, Object val) throws JSExn { (entries==null?entries=new Hash():entries).put(key,null,val); }
     public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
-        throw new JSExn("attempted to call the null value (method "+method+")");
+        throw new JSExn("you cannot call this object (class=" + this.getClass().getName() +")");
     }    
+    // FIXME: JSArgs objects, pointers into stack frame
     public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
         throw new JSExn("you cannot call this object (class=" + this.getClass().getName() +")");
     }