[JS IR] Optimize JS AST for closures

^KT-58891 Fixed
This commit is contained in:
Alexander Korepanov
2023-07-06 22:17:50 +02:00
committed by Space Team
parent 524c475834
commit a588e75c11
9 changed files with 136 additions and 2 deletions
@@ -19,5 +19,9 @@ package org.jetbrains.kotlin.js.testOld.optimizer
import org.junit.Test
class DeadCodeEliminationTest : BasicOptimizerTest("dead-code-elimination") {
@Test fun switchCases() = box()
}
@Test
fun switchCases() = box()
@Test
fun afterReturn() = box()
}
@@ -6928,6 +6928,12 @@ public class FirJsBoxTestGenerated extends AbstractFirJsBoxTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/jsAstOptimizations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("deadCodeElimination.kt")
public void testDeadCodeElimination() throws Exception {
runTest("js/js.translator/testData/box/jsAstOptimizations/deadCodeElimination.kt");
}
@Test
@TestMetadata("tempVarDeclOnAssignment.kt")
public void testTempVarDeclOnAssignment() throws Exception {
@@ -7034,6 +7034,12 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/jsAstOptimizations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@Test
@TestMetadata("deadCodeElimination.kt")
public void testDeadCodeElimination() throws Exception {
runTest("js/js.translator/testData/box/jsAstOptimizations/deadCodeElimination.kt");
}
@Test
@TestMetadata("tempVarDeclOnAssignment.kt")
public void testTempVarDeclOnAssignment() throws Exception {
@@ -6928,6 +6928,12 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/jsAstOptimizations"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
}
@Test
@TestMetadata("deadCodeElimination.kt")
public void testDeadCodeElimination() throws Exception {
runTest("js/js.translator/testData/box/jsAstOptimizations/deadCodeElimination.kt");
}
@Test
@TestMetadata("tempVarDeclOnAssignment.kt")
public void testTempVarDeclOnAssignment() throws Exception {