3 /** anything that is callable with the () operator and wasn't compiled from JS code */
4 public abstract class JSCallable extends JSObj {
5 public Object call0(Object method) throws JS.Exn {
6 JSArray args = new JSArray();
7 return call(method, args);
9 public Object call1(Object method, Object arg1) throws JS.Exn {
10 JSArray args = new JSArray();
11 args.addElement(arg1);
12 return call(method, args);
14 public Object call2(Object method, Object arg1, Object arg2) throws JS.Exn {
15 JSArray args = new JSArray();
16 args.addElement(arg1);
17 args.addElement(arg2);
18 return call(method, args);
20 public Object call(Object method, JSArray args) throws JS.Exn {
21 throw new JS.Exn("cannot invoke this method with " + args.size() + " arguments");