[K/JS] Support companion objects in external and exported declarations

This commit is contained in:
Artem Kobzar
2024-02-27 16:30:13 +00:00
committed by Space Team
parent 5cda3fba12
commit 3429cbd321
51 changed files with 551 additions and 56 deletions
@@ -0,0 +1,7 @@
define("bar", [], function() {
return {
Bar: {
ok() { return "OK" }
}
};
});
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JS_IR
// TARGET_BACKEND: JS_IR_ES6
// EXPECTED_REACHABLE_NODES: 1238
// MODULE_KIND: AMD
// FILE: bar.kt
@file:JsModule("bar")
package bar
external interface Bar {
companion object {
fun ok(): String
}
}
// FILE: test.kt
import bar.Bar
inline fun Bar.Companion.test() = "CHECK"
fun box(): String {
Bar.test()
return Bar.ok()
}