[JS IR] Do not copy prototype references of FO from super class

Reduce bundle size from issue from 4.9M to 3.4M

 - fix KT-41227
 - add simple test
This commit is contained in:
Roman Artemev
2020-10-16 15:17:04 +03:00
parent 99a6bdeec7
commit 4d63ecd83c
5 changed files with 54 additions and 2 deletions
@@ -0,0 +1,32 @@
// EXPECTED_REACHABLE_NODES: 1251
// KT-41227
var result = ""
open class A {
@JsName("foo")
fun foo() { result += "A" }
@JsName("boo")
open fun boo() { result += "FAIL" }
}
class B : A() {
override fun boo() { result += "B" }
@JsName("bar")
fun bar() { result += "C" }
}
fun box(): String {
val b = B()
b.boo()
b.foo()
b.bar()
if (result != "BAC") return "FAIL: $result"
return "OK"
}
// PROPERTY_WRITE_COUNT: name=foo count=1
// PROPERTY_WRITE_COUNT: name=boo count=2
// PROPERTY_WRITE_COUNT: name=bar count=1