Files
kotlin-fork/js/js.translator/testData/_commonFiles/testUtils.kt
T
Svyatoslav Kuzmich fd67464d14 [Wasm] Test infra: support _commonFiles and additional .mjs
Use custom `evalToBoolean` as `eval` and `unsafeCast` are not
 available in Wasm stdlib
2023-01-13 21:58:33 +00:00

10 lines
316 B
Kotlin
Vendored

package testUtils
@JsName("eval")
private external fun evalToBoolean(code: String): Boolean
fun isLegacyBackend(): Boolean =
// Using eval to prevent DCE from thinking that following code depends on Kotlin module.
evalToBoolean("(typeof Kotlin != \"undefined\" && typeof Kotlin.kotlin != \"undefined\")")