}
/** Note: code gets run in an <i>unpauseable</i> context. */
- public Object call(JSArray args) {
+ public Object call(Object a0, Object a1, Object a2, Object[] rest, int nargs) {
JSContext cx = new JSContext(this, false);
+ JSArray args = new JSArray();
+ if (nargs > 0) args.addElement(a0);
+ if (nargs > 1) args.addElement(a1);
+ if (nargs > 2) args.addElement(a2);
+ for(int i=3; i<nargs; i++) args.addElement(rest[i-3]);
cx.invoke(args);
return cx.stack.pop();
}