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