ScriptVariables

Holds the variables a KotlinScript binds, under a single engine binding.

The Kotlin JSR-223 engine turns every binding into a script property typed by the value's runtime class. A lambda or a JDK-internal class then makes every later evaluation fail to compile, and on Kotlin 2.4.20 so does any generic Java class such as ArrayList. Binding only this public, non-generic holder avoids all of that: generated code reads each variable from it and casts it to a type the script can name.

It is public only because generated script code names it; there is no reason to use it directly.

Functions

Link copied to clipboard
operator fun get(name: String): Any?

Returns the value bound under name, or null if there is none.