JS backend: basic support for class literals.

Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed
This commit is contained in:
Zalim Bashorov
2016-10-04 17:39:37 +03:00
parent ace10f46b2
commit 3c520a3ce3
14 changed files with 310 additions and 21 deletions
@@ -6252,6 +6252,30 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/jsClassSimpleName.kt");
doTest(fileName);
}
@TestMetadata("kClass.kt")
public void testKClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/kClass.kt");
doTest(fileName);
}
@TestMetadata("kClassOnReifiedType.kt")
public void testKClassOnReifiedType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/kClassOnReifiedType.kt");
doTest(fileName);
}
@TestMetadata("kClassSimpleName.kt")
public void testKClassSimpleName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/kClassSimpleName.kt");
doTest(fileName);
}
@TestMetadata("kClassToAndFromJsClass.kt")
public void testKClassToAndFromJsClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reflection/kClassToAndFromJsClass.kt");
doTest(fileName);
}
}
@TestMetadata("js/js.translator/testData/box/regression")