Files
kotlin-fork/js/js.translator/testData/box/native/eval.kt
T
2021-10-25 00:14:19 +03:00

18 lines
338 B
Kotlin
Vendored

// SKIP_MINIFICATION
val top = "TOP LEVEL"
fun box(): String {
// Does't work in Rhino, but should.
// val v = 1
// assertEquals(3, eval("v + 2"))
assertEquals(5, eval("3 + 2"))
if (testUtils.isLegacyBackend()) {
val PACKAGE = "main"
assertEquals(top, eval("$PACKAGE.top"))
}
return "OK"
}