[K/JS] Add support of compilation with ES-classes

This commit is contained in:
Artem Kobzar
2023-01-17 18:14:17 +00:00
committed by Space Team
parent 8d728d4f53
commit 71486a321c
239 changed files with 57567 additions and 1658 deletions
@@ -0,0 +1,24 @@
@JsName("Set")
external class JsSet<T> {
fun has(value: T): Boolean
}
external open class JsFoo(value: String) {
val value: String
companion object {
val instances: JsSet<JsFoo>
}
}
class KotlinFoo(value: String) : JsFoo(value) {
fun existsInJs(): Boolean = JsFoo.instances.has(this)
}
fun box(): String {
val foo = KotlinFoo("TEST")
assertEquals("TEST", foo.value)
assertEquals(true, foo.existsInJs())
return "OK"
}