[JS IR BE] support more constructions:

* generate declaration for top level properties
* basic support for calls
* break
* continue
* throw
* generate declaration for local vals and vars
This commit is contained in:
Zalim Bashorov
2018-03-19 17:06:22 +03:00
parent 560e35174b
commit 68457a55a8
9 changed files with 124 additions and 63 deletions
@@ -7383,18 +7383,7 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
@TestMetadata("useVariableOfNameOfFunction.kt")
public void testUseVariableOfNameOfFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/identifierClash/useVariableOfNameOfFunction.kt");
if (KotlinTestUtils.RUN_IGNORED_TESTS_AS_REGULAR) {
doTest(fileName);
return;
}
try {
doTest(fileName);
}
catch (Throwable ignore) {
ignore.printStackTrace();
return;
}
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive or add it to whitelist for that.");
doTest(fileName);
}
}
@@ -8618,18 +8607,7 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
@TestMetadata("stringConstant.kt")
public void testStringConstant() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/expression/stringClass/stringConstant.kt");
if (KotlinTestUtils.RUN_IGNORED_TESTS_AS_REGULAR) {
doTest(fileName);
return;
}
try {
doTest(fileName);
}
catch (Throwable ignore) {
ignore.printStackTrace();
return;
}
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive or add it to whitelist for that.");
doTest(fileName);
}
@TestMetadata("stringInTemplate.kt")
@@ -16617,18 +16595,7 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
@TestMetadata("nestedPackageFunctionCalledFromOtherPackage.kt")
public void testNestedPackageFunctionCalledFromOtherPackage() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/multiPackage/nestedPackageFunctionCalledFromOtherPackage.kt");
if (KotlinTestUtils.RUN_IGNORED_TESTS_AS_REGULAR) {
doTest(fileName);
return;
}
try {
doTest(fileName);
}
catch (Throwable ignore) {
ignore.printStackTrace();
return;
}
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive or add it to whitelist for that.");
doTest(fileName);
}
@TestMetadata("packageVariableVisibleFromOtherPackage.kt")
@@ -19177,18 +19144,7 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
@TestMetadata("deeplyNestedPackageFunctionCalled.kt")
public void testDeeplyNestedPackageFunctionCalled() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/package/deeplyNestedPackageFunctionCalled.kt");
if (KotlinTestUtils.RUN_IGNORED_TESTS_AS_REGULAR) {
doTest(fileName);
return;
}
try {
doTest(fileName);
}
catch (Throwable ignore) {
ignore.printStackTrace();
return;
}
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive or add it to whitelist for that.");
doTest(fileName);
}
@TestMetadata("initializersOfNestedPackagesExecute.kt")