JS: prevent compiler from importing module more than once if not necessary. See KT-15260

This commit is contained in:
Alexey Andreev
2016-12-22 13:19:07 +03:00
committed by Alexey Andreev
parent 1ecd957981
commit 9b4b7960d3
7 changed files with 93 additions and 7 deletions
@@ -0,0 +1,17 @@
// MODULE_KIND: COMMON_JS
// FUNCTION_CALLED_TIMES: require count=2
@JsModule("lib")
external fun f(x: Int): String
@JsModule("lib")
external fun f(x: String): String
@JsModule("lib")
external fun g(x: Boolean): String
fun box(): String {
val result = f(23) + f("foo") + g(true)
if (result != "abc") return "fail: $result"
return "OK"
}