Scriptable thisObj,
Object[] args,
Function funObj)
throws JavaScriptException {
int len = args.length;
Window window = ((RhinoInterpreter.ExtendedContext)cx).getWindow();
if (len < 2) {
throw Context.reportRuntimeError("invalid argument count");
}
long to = ((Long)Context.toType(args[1], Long.TYPE)).longValue();
if (args[0] instanceof Function) {
RhinoInterpreter interp =
(RhinoInterpreter)window.getInterpreter();
FunctionWrapper fw;
fw = new FunctionWrapper(interp, (Function)args[0],
EMPTY_ARGUMENTS);
return Context.toObject(window.setInterval(fw, to), thisObj);
}
String script =
(String)Context.toType(args[0], String.class);
return Context.toObject(window.setInterval(script, to), thisObj);
}