2003/11/17 05:23:32
[org.ibex.core.git] / src / org / xwt / js / Internal.java
index 4cddef1..d1ac346 100644 (file)
@@ -130,8 +130,11 @@ class Internal {
             final Object target = o;
             final String method = key.toString();
             return new JSCallable() {
-                    // FIXME
-                public Object call(Object notUsed, JSArray args) { return callMethodOnPrimitive(target,method,args); }
+                    public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) {
+                        JSArray args = new JSArray();
+                        for(int i=0; i<nargs; i++) args.addElement(i==0?a0:i==1?a1:i==2?a2:rest[i-3]);
+                        return callMethodOnPrimitive(target,method,args);
+                    }
             };
         }
         return null;
@@ -139,7 +142,7 @@ class Internal {
     
     static class JSCallableStub extends JSCallable {
         private Object method;
-        private JS obj;
+        JS obj;
         public JSCallableStub(JS obj, Object method) { this.obj = obj; this.method = method; }
         public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) {
             return ((JSCallable)obj).callMethod(method, a0, a1, a2, rest, nargs);