[JS IR] Review remarks

- Move origin to common place
- Add comments and todo about solution
- Remove MODULE directive from tests
- Add test with in-place using of js function
This commit is contained in:
Ilya Goncharov
2021-05-14 13:27:08 +03:00
committed by TeamCityServer
parent 507516e44d
commit 74d1812461
10 changed files with 66 additions and 10 deletions
@@ -0,0 +1,38 @@
import kotlin.reflect.KClass
// FILE: main.kt
external abstract open class A(
o: String
) {
abstract val k: String
fun test(): String
}
class B(
o: String
) : A(o) {
override val k = "K"
}
external fun test(
klazz: Any
) : B
fun box(): String {
return test(B::class.js).test()
}
// FILE: test.js
function test(classType) {
return new classType("O")
}
function A(o) {
this.o = o
}
A.prototype.test = function() {
return this.o + this.k
}