Implement property for explicit jvmTarget for script definition...

Apply the property to the default JSR-223 script taking the value from
java.specification.version property, so effectively implementing
jvmTarget detection from current VM.
Also drop enforcing of target 1.8, using common default.
#KT-49329 fixed
#KT-40497 fixed
This commit is contained in:
Ilya Chernikov
2021-12-03 17:29:30 +01:00
committed by TeamCityServer
parent f0316cde54
commit 1450f4d890
6 changed files with 108 additions and 8 deletions
@@ -0,0 +1,9 @@
import javax.script.*
inline fun<T> foo(body: () -> T): T = body()
fun main() {
val scriptEngine = ScriptEngineManager().getEngineByExtension("kts")!!
scriptEngine.eval("println(foo { \"OK\" })")
}