Provide optimized code generation for for-in-withIndex for arrays

#KT-5177 In Progress
This commit is contained in:
Dmitry Petrov
2018-01-19 15:25:32 +03:00
parent e07e9c0ea5
commit 08622b0953
23 changed files with 664 additions and 9 deletions
@@ -5760,6 +5760,51 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ForInArrayWithIndex extends AbstractJsCodegenBoxTest {
public void testAllFilesPresentInForInArrayWithIndex() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("forInArrrayWithIndexNoElementVar.kt")
public void testForInArrrayWithIndexNoElementVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrrayWithIndexNoElementVar.kt");
doTest(fileName);
}
@TestMetadata("forInArrrayWithIndexNoIndexVar.kt")
public void testForInArrrayWithIndexNoIndexVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrrayWithIndexNoIndexVar.kt");
doTest(fileName);
}
@TestMetadata("forInArrrayWithIndexWithExplicitlyTypedIndexVariable.kt")
public void testForInArrrayWithIndexWithExplicitlyTypedIndexVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInArrrayWithIndexWithExplicitlyTypedIndexVariable.kt");
doTest(fileName);
}
@TestMetadata("forInEmptyArrrayWithIndex.kt")
public void testForInEmptyArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInEmptyArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInIntArrrayWithIndex.kt")
public void testForInIntArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInIntArrrayWithIndex.kt");
doTest(fileName);
}
@TestMetadata("forInObjectArrrayWithIndex.kt")
public void testForInObjectArrrayWithIndex() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/controlStructures/forInArrayWithIndex/forInObjectArrrayWithIndex.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/controlStructures/returnsNothing")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)