Edoardo Luppi
10/01/2026, 12:54 PM@JsExport
class TestExport(val two: String) {
var one: Int
get() = 12
set(value) {
println("set one to $value")
}
}
The outputted code is:
class TestExport {
constructor(two) {
this.two = two;
}
k1() {
return this.two;
}
l1(value) {
println('set one to ' + value);
}
m1() {
return 12;
}
get one() {
return this.m1();
}
set one(value) {
this.l1(value);
}
}
As you can see there is overlap between m1() and get one(), or l1() and set one().
We effectively have a public interface and a private interface used inside the Kotlin module. Question: is this by choice or is the simplification into one single merged interface not technically possible (or just too difficult)?Artem Kobzar
10/01/2026, 1:53 PMget/set keyword with full name, instead of a function with a minified name.Edoardo Luppi
10/01/2026, 1:57 PMbut we just need in all the overrides to write extraAh yup! Forgot about this and it's an interesting point. It does not impact only overrides, but also "internal" calls. If we have hundreds of calls of those getters and setters inside the Kotlin module, we might end up with a bigger bundle.keyword with full name, instead of a function with a minified nameget/set