Files
kotlin-fork/compiler/testData/codegen/boxWasmJsInterop/kt59082.kt
T
Svyatoslav Kuzmich 384c700a85 [Wasm] Fix access to WebIDL dictionary members
Evaluate external interface companion objects as an empty JS object
instead of null due to null checks on interop boundary.

^KT-59082 Fixed
2023-07-25 15:27:22 +00:00

16 lines
406 B
Kotlin
Vendored

// TARGET_BACKEND: WASM
@JsName("null")
@Suppress("NESTED_CLASS_IN_EXTERNAL_INTERFACE")
public external interface CanvasFillRule : JsAny {
companion object
}
public inline val CanvasFillRule.Companion.EVENODD: CanvasFillRule get() =
"evenodd".toJsString().unsafeCast<CanvasFillRule>()
fun box(): String {
if (CanvasFillRule.EVENODD.toString() != "evenodd") return "Fail 1"
return "OK"
}