JS: don't throw AssertionError from RedundantCallElimination

Also mark JS `call` function to avoid removing a custom `call`
This commit is contained in:
Anton Bannykh
2018-08-10 18:12:03 +03:00
parent 0895f72570
commit 4e496cf2b2
7 changed files with 49 additions and 4 deletions
@@ -0,0 +1,27 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1189
// MODULE: lib
// FILE: lib.kt
fun String.call() = this + "O"
inline fun O() = "".call()
object A {
val foo = Foo
}
object Foo {
@JsName("call")
fun call(a: A, k: String) = k
}
inline fun K(a: A) = a.foo.call(a, "K")
// MODULE: main(lib)
// FILE: main.kt
val a = A
fun box() = O() + K(a)