- Loading...
...
Any Java object that is an instance of lambda type can be treated like a script function.
| Code Block | ||
|---|---|---|
| ||
var Function = Java.type('java.util.function.Function')
var obj = new Function() {
apply: function(x) { print(x*x) }
}
// every lambda object is a 'function'
print(typeof obj); // prints "function"
// 'calls' lambda as though it is a function
obj(91); |
...
JSAdapter supports java.lang.reflect.Proxy-like proxy mechanism for script objects.
...