evalScript

fun evalScript(script: String, verbose: Boolean = false): Any?

Evaluates a raw Java script string, prepending any registered import declarations.

On the first call, registered variable bindings are placed into the engine context.

Return

the result of the script evaluation, or null if the script evaluates to null

Parameters

script

the Java source code to evaluate

verbose

if true, logs the generated script before evaluation