KT-2752: add test to ensure that JsName affects classes

This commit is contained in:
Alexey Andreev
2016-06-23 17:31:16 +03:00
parent b888d9e7d9
commit fb7f221158
3 changed files with 39 additions and 6 deletions
+27
View File
@@ -0,0 +1,27 @@
package foo
@JsName("AA") object A {
@JsName("foo") fun foo() = "A.foo"
}
@JsName("BB") class B {
@JsName("foo") fun foo() = "B.foo"
}
fun testA() = js("""
var a = Kotlin.modules.JS_TESTS.foo.AA;
return a.foo();
""")
fun testB() = js("""
var b = new Kotlin.modules.JS_TESTS.foo.BB();
return b.foo();
""")
fun box(): String {
assertEquals("A.foo", testA())
assertEquals("B.foo", testB())
return "OK"
}