public static JS wrap(Object o) throws JSExn {
if (o == null) return null;
- if (o instanceof String) return JS.S((String)o);
- if (o instanceof Boolean) return JS.B(((Boolean)o).booleanValue());
- if (o instanceof Number) return JS.N((Number)o);
+ if (o instanceof String) return Script.S((String)o);
+ if (o instanceof Boolean) return Script.B(((Boolean)o).booleanValue());
+ if (o instanceof Number) return Script.N((Number)o);
if (o instanceof JS) return (JS)o;
if (o instanceof Object[]) {
// FIXME: get element type here
private int n = 0;
public boolean _hasMoreElements() { return n < arr.length; }
public JS _nextElement() {
- return n >= arr.length ? null : JS.N(n++);
+ return n >= arr.length ? null : Script.N(n++);
}
};
}
} catch (InvocationTargetException it) {
Throwable ite = it.getTargetException();
if (ite instanceof JSExn) throw ((JSExn)ite);
- JS.warn(ite);
+ Script.warn(ite);
throw new JSExn("unhandled reflected exception: " + ite.toString());
} catch (SecurityException nfe) { }
throw new JSExn("called a reflection method with the wrong number of arguments");