- private Object stringFromCharCode(JSArray args) {
- char buf[] = new char[args.length()];
- for(int i=0;i<args.length();i++) buf[i] = (char)(JS.toInt(args.elementAt(i)) & 0xffff);
- return new String(buf);
+ public Object callMethod(Object method, Object a0, Object a1, Object a2, Object[] rest, int nargs) throws JSExn {
+ switch(nargs) {
+ case 0: {
+ //#switch(method)
+ case "stringFromCharCode":
+ char buf[] = new char[nargs];
+ for(int i=0; i<nargs; i++) buf[i] = (char)(JS.toInt(i==0?a0:i==1?a1:i==2?a2:rest[i-3]) & 0xffff);
+ return new String(buf);
+ //#end
+ break;
+ }
+ case 1: {
+ //#switch(method)
+ case "parseInt": return parseInt(a0, N(0));
+ case "isNaN": { double d = toDouble(a0); return d == d ? F : T; }
+ case "isFinite": { double d = toDouble(a0); return (d == d && !Double.isInfinite(d)) ? T : F; }
+ case "decodeURI": throw new JSExn("unimplemented");
+ case "decodeURIComponent": throw new JSExn("unimplemented");
+ case "encodeURI": throw new JSExn("unimplemented");
+ case "encodeURIComponent": throw new JSExn("unimplemented");
+ case "escape": throw new JSExn("unimplemented");
+ case "unescape": throw new JSExn("unimplemented");
+ //#end
+ break;
+ }
+ case 2: {
+ //#switch(method)
+ case "parseInt": return parseInt(a0, a1);
+ //#end
+ break;
+ }
+ }
+ return super.callMethod(method, a0, a1, a2, rest, nargs);