public interface JsFunction extends JsObject
IllegalStateException
.Modifier and Type | Method and Description |
---|---|
<T> T |
invoke(JsObject object,
java.lang.Object... args)
Invokes this function on the given
object with the specified args . |
call, frame, hasProperty, ownPropertyNames, property, propertyNames, putProperty, removeProperty
<T> T invoke(@Nullable JsObject object, java.lang.Object... args)
object
with the specified args
. This
method blocks the current thread until the function finishes its execution. If the function
raises an exception, then a JsException
with an error message that describes the
exception reason will be thrown. The same error message will be printed to the JavaScript
console.
The rules to convert Java types into JavaScript types and vice versa are the same as for
the JsObject.call(String, Object...)
method.
T
- the result of the JavaScript function executionobject
- the JavaScript object to invoke this function on. Pass null
to invoke
the function as a global function.args
- the list of input argumentsJsException
- when an error occurs during the function executionjava.lang.IllegalArgumentException
- when args
contains an unsupported typejava.lang.IllegalStateException
- when the JavaScript object is already disposed or invalid