[K/JS] Move ES modules logic to a new transformer with IC
This commit is contained in:
@@ -1906,18 +1906,6 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest {
|
||||
public void testAllFilesPresentInExport() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/esModules/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameStableNameMethod.kt")
|
||||
public void testOverriddenExternalMethodWithSameStableNameMethod() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reservedModuleName.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+138
@@ -2217,35 +2217,173 @@ public class FirJsTestGenerated extends AbstractFirJsTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/esModules/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bridgeSavingAfterExport.kt")
|
||||
public void testBridgeSavingAfterExport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/bridgeSavingAfterExport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bridgeSavingAfterExportInExportedFile.kt")
|
||||
public void testBridgeSavingAfterExportInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/bridgeSavingAfterExportInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineClassConstructorParam.kt")
|
||||
public void testDefaultInlineClassConstructorParam() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/defaultInlineClassConstructorParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineClassConstructorParamInExportedFile.kt")
|
||||
public void testDefaultInlineClassConstructorParamInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/defaultInlineClassConstructorParamInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportAllFile.kt")
|
||||
public void testExportAllFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportAllFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportEnumClass.kt")
|
||||
public void testExportEnumClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportEnumClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithEnumClass.kt")
|
||||
public void testExportFileWithEnumClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithEnumClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithInterface.kt")
|
||||
public void testExportFileWithInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithNestedClass.kt")
|
||||
public void testExportFileWithNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithNestedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithNestedObject.kt")
|
||||
public void testExportFileWithNestedObject() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithNestedObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithProtectedMembers.kt")
|
||||
public void testExportFileWithProtectedMembers() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithProtectedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithTopLevelProperty.kt")
|
||||
public void testExportFileWithTopLevelProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithTopLevelProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportInnerClass.kt")
|
||||
public void testExportInnerClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportInnerClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportInterface.kt")
|
||||
public void testExportInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportNestedClass.kt")
|
||||
public void testExportNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportNestedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportNestedObject.kt")
|
||||
public void testExportNestedObject() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportNestedObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportProtectedMembers.kt")
|
||||
public void testExportProtectedMembers() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportProtectedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportTopLevelProperty.kt")
|
||||
public void testExportTopLevelProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportTopLevelProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonIndetifierModuleName.kt")
|
||||
public void testNonIndetifierModuleName() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/nonIndetifierModuleName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonIndetifierModuleNameInExportedFile.kt")
|
||||
public void testNonIndetifierModuleNameInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/nonIndetifierModuleNameInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenChainNonExportIntermediate.kt")
|
||||
public void testOverriddenChainNonExportIntermediate() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenChainNonExportIntermediate.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenChainNonExportIntermediateInExportedFile.kt")
|
||||
public void testOverriddenChainNonExportIntermediateInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenChainNonExportIntermediateInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameNameMethod.kt")
|
||||
public void testOverriddenExternalMethodWithSameNameMethod() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameNameMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameStableNameMethod.kt")
|
||||
public void testOverriddenExternalMethodWithSameStableNameMethod() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt")
|
||||
public void testOverriddenExternalMethodWithSameStableNameMethodInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reservedModuleName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleNameInExportedFile.kt")
|
||||
public void testReservedModuleNameInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reservedModuleNameInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("vararg.kt")
|
||||
public void testVararg() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/vararg.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
+138
@@ -2217,35 +2217,173 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/esModules/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bridgeSavingAfterExport.kt")
|
||||
public void testBridgeSavingAfterExport() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/bridgeSavingAfterExport.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bridgeSavingAfterExportInExportedFile.kt")
|
||||
public void testBridgeSavingAfterExportInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/bridgeSavingAfterExportInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineClassConstructorParam.kt")
|
||||
public void testDefaultInlineClassConstructorParam() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/defaultInlineClassConstructorParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("defaultInlineClassConstructorParamInExportedFile.kt")
|
||||
public void testDefaultInlineClassConstructorParamInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/defaultInlineClassConstructorParamInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportAllFile.kt")
|
||||
public void testExportAllFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportAllFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportEnumClass.kt")
|
||||
public void testExportEnumClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportEnumClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithEnumClass.kt")
|
||||
public void testExportFileWithEnumClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithEnumClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithInterface.kt")
|
||||
public void testExportFileWithInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithNestedClass.kt")
|
||||
public void testExportFileWithNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithNestedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithNestedObject.kt")
|
||||
public void testExportFileWithNestedObject() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithNestedObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithProtectedMembers.kt")
|
||||
public void testExportFileWithProtectedMembers() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithProtectedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportFileWithTopLevelProperty.kt")
|
||||
public void testExportFileWithTopLevelProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportFileWithTopLevelProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportInnerClass.kt")
|
||||
public void testExportInnerClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportInnerClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportInterface.kt")
|
||||
public void testExportInterface() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportNestedClass.kt")
|
||||
public void testExportNestedClass() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportNestedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportNestedObject.kt")
|
||||
public void testExportNestedObject() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportNestedObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportProtectedMembers.kt")
|
||||
public void testExportProtectedMembers() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportProtectedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exportTopLevelProperty.kt")
|
||||
public void testExportTopLevelProperty() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/exportTopLevelProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonIndetifierModuleName.kt")
|
||||
public void testNonIndetifierModuleName() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/nonIndetifierModuleName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nonIndetifierModuleNameInExportedFile.kt")
|
||||
public void testNonIndetifierModuleNameInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/nonIndetifierModuleNameInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenChainNonExportIntermediate.kt")
|
||||
public void testOverriddenChainNonExportIntermediate() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenChainNonExportIntermediate.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenChainNonExportIntermediateInExportedFile.kt")
|
||||
public void testOverriddenChainNonExportIntermediateInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenChainNonExportIntermediateInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameNameMethod.kt")
|
||||
public void testOverriddenExternalMethodWithSameNameMethod() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameNameMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameStableNameMethod.kt")
|
||||
public void testOverriddenExternalMethodWithSameStableNameMethod() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethod.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt")
|
||||
public void testOverriddenExternalMethodWithSameStableNameMethodInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/overriddenExternalMethodWithSameStableNameMethodInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleName.kt")
|
||||
public void testReservedModuleName() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reservedModuleName.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("reservedModuleNameInExportedFile.kt")
|
||||
public void testReservedModuleNameInExportedFile() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/reservedModuleNameInExportedFile.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("vararg.kt")
|
||||
public void testVararg() throws Exception {
|
||||
runTest("js/js.translator/testData/box/esModules/export/vararg.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
Generated
+12
@@ -456,6 +456,12 @@ public class IrJsTypeScriptExportTestGenerated extends AbstractIrJsTypeScriptExp
|
||||
runTest("js/js.translator/testData/typescript-export/module-systems/commonjs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("esm.kt")
|
||||
public void testEsm() throws Exception {
|
||||
runTest("js/js.translator/testData/typescript-export/module-systems/esm.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("plain.kt")
|
||||
public void testPlain() throws Exception {
|
||||
@@ -484,6 +490,12 @@ public class IrJsTypeScriptExportTestGenerated extends AbstractIrJsTypeScriptExp
|
||||
runTest("js/js.translator/testData/typescript-export/module-systems-in-exported-file/commonjs.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("esm.kt")
|
||||
public void testEsm() throws Exception {
|
||||
runTest("js/js.translator/testData/typescript-export/module-systems-in-exported-file/esm.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("plain.kt")
|
||||
public void testPlain() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user