How does one prohibit the mangling of abstract cla...
# javascript
s
How does one prohibit the mangling of abstract class implementation overridden property names with
@JsName("prop")
?
Copy code
abstract class SomeClass {
    @JsName("someProp")
    abstract var someProp: String
}

class SomeClassImpl : SomeClass() {
    override var someProp: String = "prop"
}


fun main() {
    console.log(SomeClassImpl())  // still mangled  - Object { "someProp_366n21$_0": "prop" }
}
e
Your override may still be getting mangled. I assume the JS build is creating SomeClass and SomeClassImpl, then setting SomeClassImpl.prototype.prototype equal to SomeClass.prototype
You should check the build output to be sure though. I’d recommend also adding the JsName to your override var.
s
Thanks for responding. The override is getting mangled. I found a different method for what I was trying to accomplish that's better than needing to use the above. The prototype does seem to have a non-mangled property of the same name. I guess I'm not really asking why, I'm sure they have their reasons, but how would one accomplish the desired behavior. As for adding JsName("") to the override, it's prohibited even if the overridden prop isn't annotated.