JS: add tests for reflection against external classes
This commit is contained in:
@@ -6818,6 +6818,12 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reflection"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reflection"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.JS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("external.kt")
|
||||||
|
public void testExternal() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/external.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("jsClass.kt")
|
@TestMetadata("jsClass.kt")
|
||||||
public void testJsClass() throws Exception {
|
public void testJsClass() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/jsClass.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/jsClass.kt");
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
function A() {
|
||||||
|
}
|
||||||
|
|
||||||
|
var O = {};
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
external class A
|
||||||
|
|
||||||
|
external object O
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
assertEquals(null, A::class.simpleName, "simpleName of external class must be null")
|
||||||
|
assertEquals(js("A"), A::class.js, "Can't get reference to external class")
|
||||||
|
|
||||||
|
assertEquals(null, O::class.simpleName, "simpleName of external object must be null")
|
||||||
|
assertEquals(js("O"), O::class.js, "Can't get reference to external object via instance")
|
||||||
|
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user