return super.get(key);
}
+ public Object call(Object method, JSArray args) {
+ if (method.equals("stringFromCharCode")) return stringFromCharCode(args);
+ return super.call(method, args);
+ }
+
public Object call1(Object method, Object arg0) {
//#switch(method)
- case "parseInt": return parseInt(arg0, 0);
+ case "parseInt": return parseInt(arg0, N(0));
case "isNaN": { double d = toDouble(arg0); return d == d ? F : T; }
- case "isFinite": { double d = toDouble(arg0); return (d == d && !Double.isFinite(d)) ? T : F; }
+ case "isFinite": { double d = toDouble(arg0); return (d == d && !Double.isInfinite(d)) ? T : F; }
case "decodeURI": throw new JS.Exn("unimplemented");
case "decodeURIComponent": throw new JS.Exn("unimplemented");
case "encodeURI": throw new JS.Exn("unimplemented");
case "encodeURIComponent": throw new JS.Exn("unimplemented");
case "escape": throw new JS.Exn("unimplemented");
case "unescape": throw new JS.Exn("unimplemented");
- case "stringFromCharCode": return stringFromCharCode(arg0);
//#end
- return null;
+ return super.call1(method, arg0);
}
public Object call2(Object method, Object arg1, Object arg2) {
if (method.equals("parseInt")) return parseInt(arg1, arg2);
- return null;
+ return super.call2(method, arg1, arg2);
}
- private Object stringFromCharCode(Object arg) {
+ private Object stringFromCharCode(JSArray args) {
char buf[] = new char[args.length()];
- for(int i=0;i<args.length();i++) buf[i] = (char)(JS.toInt(arg) & 0xffff);
+ for(int i=0;i<args.length();i++) buf[i] = (char)(JS.toInt(args.elementAt(i)) & 0xffff);
return new String(buf);
}
- private Object parseInt(Object arg, int radix) {
+ private Object parseInt(Object arg, Object r) {
+ int radix = JS.toInt(r);
String s = (String)arg;
int start = 0;
int length = s.length();