quickjs-wrapper
quickjs-wrapper copied to clipboard
how to get and run Function
my code, says not a function
app.set( "queue", args -> {
try {
int delay = args.length > 1 ? (int) args[1] : 0;
task.run(() -> {try {
JSFunction func = (JSFunction) args[0];
func.call(new Object[]{"wave"});
} catch (Exception e0) {
runOnUiThread(() -> toast(e0.toString()));
}}, delay);
} catch (Exception e) {
runOnUiThread(() -> toast(e.getMessage()));
}
});