andylamax
02/09/2022, 5:01 PM@JsExport
, properties of interfaces/abstract classes, are still mangled. It should be known that methods
are not mangled at all
Reproducer
Reproducer can be found at ManglingImplementationTestandylamax
02/09/2022, 5:02 PM@JsExport
interface State<out T> {
val value: T
}
@JsExport
interface MutableState<T> : State<T> {
override var value: T
}
class MutableStateImpl<T>(override var value: T) : MutableState<T>
would cause this test to fail
kt
val state: State<Int> = MutableStateImpl(0)
window.asDynamic().state = state
assertEquals(0, window.asDynamic().state.value) // expected: 0, actual: undefined
Expected Behaviour
This test should pass since State
was marked with @JsExport
, therefore, MutableStateImpl
should respect, State's export as it implements it
kt
val state: State<Int> = MutableStateImpl(0)
window.asDynamic().state = state
assertEquals(0, window.asDynamic().state.value) // expected: 0, actual: undefined
andylamax
02/09/2022, 5:03 PM