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() +")");
}
if((int)d == d) return Integer.toString((int)d);
return o.toString();
}
+ if (o instanceof JS) return ((JS)o).coerceToString(); // HACK for now, this will probably go away
throw new RuntimeException("can't coerce "+o+" [" + o.getClass().getName() + "] to type String.");
}
+ public String coerceToString() {
+ throw new RuntimeException("can't coerce "+this+" [" + getClass().getName() + "] to type String.");
+ }
+
// Instance Methods ////////////////////////////////////////////////////////////////////
public static final Integer ZERO = new Integer(0);