evaluateAs

inline fun <T> evaluateAs(script: String): T

Executes the selected script and returns an instance of T. If the script is not an instance of T, ClassCastException will be thrown. If unable to execute the script, ScriptEngineException will be thrown.


inline fun <T> evaluateAs(scriptFile: FileHandle): T

Executes the selected scriptFile and returns an instance of T. If the script is not an instance of T, ClassCastException will be thrown. If unable to execute the script, ScriptEngineException will be thrown.