final String s = (String) code;
final JavaScriptStringJob job = new JavaScriptStringJob(timeout, timeout, description, w, s);
id = getWebWindow().getJobManager().addJob(job, page);
}
else if (code instanceof Function) {
final Function f = (Function) code;
final JavaScriptFunctionJob job = new JavaScriptFunctionJob(timeout, timeout, description, w, f);
id = getWebWindow().getJobManager().addJob(job, page);
}
else {
throw Context.reportRuntimeError("Unknown type for function.");