}
Object ret = null;
if (o == null) throw je("tried to get property \"" + v + "\" from the null value");
- if (v == null) throw je("tried to get the null key from " + v);
+ if (v == null) throw je("tried to get the null key from " + o);
if (o instanceof String) {
ret = getFromString((String)o, v);
} else if (o instanceof Boolean) {
boolean ret;
if (l == null) { Object tmp = r; r = l; l = tmp; }
if (l == null && r == null) ret = true;
+ else if (r == null) ret = false; // l != null, so its false
else if (l instanceof Boolean) ret = new Boolean(JS.toBoolean(r)).equals(l);
else if (l instanceof Number) ret = JS.toNumber(r).doubleValue() == JS.toNumber(l).doubleValue();
else if (l instanceof String) ret = r != null && l.equals(r.toString());
if (args.length() != 1) return null;
return new Integer(((String)o).indexOf(args.elementAt(0).toString()));
} };
+ else if(v.equals("match")) return new JS.Callable() {
+ public Object call(JS.Array args) {
+ return Regexp.stringMatch(o,args);
+ } };
+ else if(v.equals("search")) return new JS.Callable() {
+ public Object call(JS.Array args) {
+ return Regexp.stringSearch(o,args);
+ } };
+ else if(v.equals("replace")) return new JS.Callable() {
+ public Object call(JS.Array args) {
+ return Regexp.stringReplace(o,args);
+ } };
+ else if(v.equals("split")) return new JS.Callable() {
+ public Object call(JS.Array args) {
+ return Regexp.stringSplit(o,args);
+ } };
+
+
throw new JS.Exn("Not Implemented: propery " + v + " on String objects");
}
}
-class JSCallable extends JS.Callable {
+/** this class exists solely to work around a GCJ bug */
+abstract class JSCallable extends JS.Callable {
+ public abstract Object call(JS.Array args) throws JS.Exn;
}