Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Any Java object that is an instance of lambda type can be treated like a script function.

 

Code Block
titlelambda as function example
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 constructor

JSAdapter supports java.lang.reflect.Proxy-like proxy mechanism for script objects.

...