Just a butch of changes to compare the current output with the J2CL output
diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt index 2cd5dc4..904e34f 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt
@@ -8,6 +8,7 @@ import org.jetbrains.kotlin.backend.common.serialization.checkIsFunctionInterface import org.jetbrains.kotlin.backend.js.JsGenerationGranularity import org.jetbrains.kotlin.config.CommonConfigurationKeys +import org.jetbrains.kotlin.config.phaser.PhaserState import org.jetbrains.kotlin.ir.backend.js.* import org.jetbrains.kotlin.ir.backend.js.export.* import org.jetbrains.kotlin.ir.backend.js.lower.JsCodeOutliningLowering @@ -205,15 +206,22 @@ val exportData = associateIrAndExport(modules) doStaticMembersLowering(modules) + val phaserState = PhaserState() + optimizationLoweringList.forEachIndexed { _, lowering -> + modules.forEach { module -> + lowering.invoke(backendContext.phaseConfig, phaserState, backendContext, module) + } + } + val result = EnumMap<TranslationMode, CompilationOutputs>(TranslationMode::class.java) modes.filter { !it.production }.forEach { result[it] = makeJsCodeGeneratorFromIr(exportData, it).generateJsCode(relativeRequirePath, true) } - if (modes.any { it.production }) { - optimizeProgramByIr(modules, backendContext, moduleKind, removeUnusedAssociatedObjects) - } +// if (modes.any { it.production }) { +// optimizeProgramByIr(modules, backendContext, moduleKind, removeUnusedAssociatedObjects) +// } modes.filter { it.production }.forEach { result[it] = makeJsCodeGeneratorFromIr(exportData, it).generateJsCode(relativeRequirePath, true) @@ -228,6 +236,13 @@ if (mode.production) { optimizeProgramByIr(modules, backendContext, moduleKind, removeUnusedAssociatedObjects) + } else { + val phaserState = PhaserState() + optimizationLoweringList.forEachIndexed { _, lowering -> + modules.forEach { module -> + lowering.invoke(backendContext.phaseConfig, phaserState, backendContext, module) + } + } } return makeJsCodeGeneratorFromIr(exportData, mode)
diff --git a/js/js.tests/testFixtures/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt b/js/js.tests/testFixtures/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt index a50aa83..1790846 100644 --- a/js/js.tests/testFixtures/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt +++ b/js/js.tests/testFixtures/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt
@@ -197,6 +197,13 @@ } } + testGroup("js/js.tests/tests-gen", "/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand", testRunnerMethodName = "runTest0") { + testClass<AbstractClosureComparisonFirJsES6BoxTest>(annotations = listOf(*es6())) { + model() + } + } + + testGroup("js/js.tests/tests-gen", "compiler/testData/codegen", testRunnerMethodName = "runTest0") { testClass<AbstractIrJsCodegenBoxTest>(annotations = listOf(*legacyFrontend())) { model("box", excludeDirs = jvmOnlyBoxTests + k2BoxTestDir)
diff --git a/js/js.tests/testFixtures/org/jetbrains/kotlin/js/test/fir/AbstractJsES6FirTest.kt b/js/js.tests/testFixtures/org/jetbrains/kotlin/js/test/fir/AbstractJsES6FirTest.kt index e3d0e47..f050307 100644 --- a/js/js.tests/testFixtures/org/jetbrains/kotlin/js/test/fir/AbstractJsES6FirTest.kt +++ b/js/js.tests/testFixtures/org/jetbrains/kotlin/js/test/fir/AbstractJsES6FirTest.kt
@@ -27,6 +27,21 @@ testGroupOutputDirPrefix = "firEs6Box/" ) +open class AbstractClosureComparisonFirJsES6BoxTest : AbstractFirJsES6Test( + pathToTestDir = "/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/", + testGroupOutputDirPrefix = "closureComparison/" +) { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + builder.defaultDirectives { + +JsEnvironmentConfigurationDirectives.ES_MODULES + +JsEnvironmentConfigurationDirectives.SPLIT_PER_FILE + +JsEnvironmentConfigurationDirectives.KJS_WITH_FULL_RUNTIME + JsEnvironmentConfigurationDirectives.DONT_RUN_GENERATED_CODE.with("JS_IR_ES6") + } + } +} + open class AbstractFirJsES6CodegenBoxTest : AbstractFirJsES6Test( pathToTestDir = "compiler/testData/codegen/box/", testGroupOutputDirPrefix = "codegen/firEs6Box/"
diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/ClosureComparisonFirJsES6BoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/ClosureComparisonFirJsES6BoxTestGenerated.java new file mode 100644 index 0000000..f257aa6 --- /dev/null +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/ClosureComparisonFirJsES6BoxTestGenerated.java
@@ -0,0 +1,759 @@ +/* + * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.js.test.fir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.junit.jupiter.api.Tag; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand") +@TestDataPath("$PROJECT_ROOT") +@Tag("es6") +public class ClosureComparisonFirJsES6BoxTestGenerated extends AbstractClosureComparisonFirJsES6BoxTest { + @Test + public void testAllFilesPresentInKotlin_js_inner_stand() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sealedclasses") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Sealedclasses { + @Test + public void testAllFilesPresentInSealedclasses() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sealedclasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Merged.kt") + public void testMerged() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sealedclasses/Merged.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/shadowing") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Shadowing { + @Test + public void testAllFilesPresentInShadowing() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/shadowing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Foo.kt") + public void testFoo() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/shadowing/Foo.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplebridgemethods") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simplebridgemethods { + @Test + public void testAllFilesPresentInSimplebridgemethods() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplebridgemethods"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimplebridgeMethods.kt") + public void testSimplebridgeMethods() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplebridgemethods/SimplebridgeMethods.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenericinterface") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simplegenericinterface { + @Test + public void testAllFilesPresentInSimplegenericinterface() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenericinterface"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimpleGenericInterface.kt") + public void testSimpleGenericInterface() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenericinterface/SimpleGenericInterface.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenerictype") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simplegenerictype { + @Test + public void testAllFilesPresentInSimplegenerictype() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenerictype"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimpleGenericType.kt") + public void testSimpleGenericType() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplegenerictype/SimpleGenericType.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simpleliterals") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simpleliterals { + @Test + public void testAllFilesPresentInSimpleliterals() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simpleliterals"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimpleLiterals.kt") + public void testSimpleLiterals() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simpleliterals/SimpleLiterals.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelocalclass") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simplelocalclass { + @Test + public void testAllFilesPresentInSimplelocalclass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelocalclass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimpleLocalClass.kt") + public void testSimpleLocalClass() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelocalclass/SimpleLocalClass.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelongs") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Simplelongs { + @Test + public void testAllFilesPresentInSimplelongs() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelongs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SimpleLongs.kt") + public void testSimpleLongs() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/simplelongs/SimpleLongs.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sourcemap") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Sourcemap { + @Test + public void testAllFilesPresentInSourcemap() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sourcemap"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SourceMap.kt") + public void testSourceMap() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/sourcemap/SourceMap.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/specialoverrides") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Specialoverrides { + @Test + public void testAllFilesPresentInSpecialoverrides() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/specialoverrides"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SpecialOverrides.kt") + public void testSpecialOverrides() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/specialoverrides/SpecialOverrides.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/statementasexpressions") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Statementasexpressions { + @Test + public void testAllFilesPresentInStatementasexpressions() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/statementasexpressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StatementAsExpressions.kt") + public void testStatementAsExpressions() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/statementasexpressions/StatementAsExpressions.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldaccesslevels") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Staticfieldaccesslevels { + @Test + public void testAllFilesPresentInStaticfieldaccesslevels() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldaccesslevels"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StaticFieldAccessLevels.kt") + public void testStaticFieldAccessLevels() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldaccesslevels/StaticFieldAccessLevels.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldinitializer") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Staticfieldinitializer { + @Test + public void testAllFilesPresentInStaticfieldinitializer() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldinitializer"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StaticFieldInitializer.kt") + public void testStaticFieldInitializer() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticfieldinitializer/StaticFieldInitializer.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticinitializers") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Staticinitializers { + @Test + public void testAllFilesPresentInStaticinitializers() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticinitializers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StaticInitializers.kt") + public void testStaticInitializers() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticinitializers/StaticInitializers.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticjsmethodswithclassnamespace") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Staticjsmethodswithclassnamespace { + @Test + public void testAllFilesPresentInStaticjsmethodswithclassnamespace() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticjsmethodswithclassnamespace"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StaticJsMethodsWithClassNamespace.kt") + public void testStaticJsMethodsWithClassNamespace() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticjsmethodswithclassnamespace/StaticJsMethodsWithClassNamespace.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticnestedclass") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Staticnestedclass { + @Test + public void testAllFilesPresentInStaticnestedclass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticnestedclass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StaticNestedClassParent.kt") + public void testStaticNestedClassParent() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/staticnestedclass/StaticNestedClassParent.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/strings") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Strings { + @Test + public void testAllFilesPresentInStrings() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/strings"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Strings.kt") + public void testStrings() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/strings/Strings.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/stringtemplate") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Stringtemplate { + @Test + public void testAllFilesPresentInStringtemplate() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/stringtemplate"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("StringTemplate.kt") + public void testStringTemplate() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/stringtemplate/StringTemplate.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subclassgenericclass") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Subclassgenericclass { + @Test + public void testAllFilesPresentInSubclassgenericclass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subclassgenericclass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SubclassGenericClass.kt") + public void testSubclassGenericClass() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subclassgenericclass/SubclassGenericClass.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subnativejstype") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Subnativejstype { + @Test + public void testAllFilesPresentInSubnativejstype() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subnativejstype"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SubNativeJsType.kt") + public void testSubNativeJsType() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subnativejstype/SubNativeJsType.kt"); + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subnativejstype/native_sources") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Native_sources { + @Test + public void testAllFilesPresentInNative_sources() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/subnativejstype/native_sources"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercalldefault") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Supercalldefault { + @Test + public void testAllFilesPresentInSupercalldefault() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercalldefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SuperCallDefault.kt") + public void testSuperCallDefault() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercalldefault/SuperCallDefault.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercallnondefault") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Supercallnondefault { + @Test + public void testAllFilesPresentInSupercallnondefault() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercallnondefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Child.kt") + public void testChild() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supercallnondefault/Child.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/superfieldaccess") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Superfieldaccess { + @Test + public void testAllFilesPresentInSuperfieldaccess() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/superfieldaccess"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SuperFieldAccess.kt") + public void testSuperFieldAccess() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/superfieldaccess/SuperFieldAccess.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supermethodcall") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Supermethodcall { + @Test + public void testAllFilesPresentInSupermethodcall() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supermethodcall"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Child.kt") + public void testChild() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/supermethodcall/Child.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/suspendfunction") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Suspendfunction { + @Test + public void testAllFilesPresentInSuspendfunction() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/suspendfunction"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("SuspendFunction.kt") + public void testSuspendFunction() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/suspendfunction/SuspendFunction.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/tailrec") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Tailrec { + @Test + public void testAllFilesPresentInTailrec() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/tailrec"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Main.kt") + public void testMain() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/tailrec/Main.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/ternaryexpression") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Ternaryexpression { + @Test + public void testAllFilesPresentInTernaryexpression() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/ternaryexpression"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("TernaryExpression.kt") + public void testTernaryExpression() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/ternaryexpression/TernaryExpression.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/toplevelmembers") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Toplevelmembers { + @Test + public void testAllFilesPresentInToplevelmembers() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/toplevelmembers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("TopLevelMembers.kt") + public void testTopLevelMembers() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/toplevelmembers/TopLevelMembers.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/transitivejsoverlayimport") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Transitivejsoverlayimport { + @Test + public void testAllFilesPresentInTransitivejsoverlayimport() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/transitivejsoverlayimport"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Main.kt") + public void testMain() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/transitivejsoverlayimport/Main.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/trycatch") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Trycatch { + @Test + public void testAllFilesPresentInTrycatch() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/trycatch"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("TryCatch.kt") + public void testTryCatch() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/trycatch/TryCatch.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typealias") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Typealias { + @Test + public void testAllFilesPresentInTypealias() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typealias"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("TypeAlias.kt") + public void testTypeAlias() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typealias/TypeAlias.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typewildcards") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Typewildcards { + @Test + public void testAllFilesPresentInTypewildcards() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typewildcards"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("TypeWildCards.kt") + public void testTypeWildCards() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/typewildcards/TypeWildCards.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unimplementedbridgemethod") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Unimplementedbridgemethod { + @Test + public void testAllFilesPresentInUnimplementedbridgemethod() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unimplementedbridgemethod"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Foo.kt") + public void testFoo() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unimplementedbridgemethod/Foo.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachableclass") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Unreachableclass { + @Test + public void testAllFilesPresentInUnreachableclass() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachableclass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Main.kt") + public void testMain() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachableclass/Main.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachablecode") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Unreachablecode { + @Test + public void testAllFilesPresentInUnreachablecode() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachablecode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Main.kt") + public void testMain() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unreachablecode/Main.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unsafevariance") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Unsafevariance { + @Test + public void testAllFilesPresentInUnsafevariance() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unsafevariance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("UnsafeVariance.kt") + public void testUnsafeVariance() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/unsafevariance/UnsafeVariance.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/varargs") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Varargs { + @Test + public void testAllFilesPresentInVarargs() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/varargs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Varargs.kt") + public void testVarargs() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/varargs/Varargs.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/variance") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Variance { + @Test + public void testAllFilesPresentInVariance() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/variance"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("Variance.kt") + public void testVariance() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/variance/Variance.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/voidtypes") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Voidtypes { + @Test + public void testAllFilesPresentInVoidtypes() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/voidtypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("VoidTypes.kt") + public void testVoidTypes() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/voidtypes/VoidTypes.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whenstatement") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Whenstatement { + @Test + public void testAllFilesPresentInWhenstatement() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whenstatement"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("WhenStatement.kt") + public void testWhenStatement() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whenstatement/WhenStatement.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whilestatement") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Whilestatement { + @Test + public void testAllFilesPresentInWhilestatement() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whilestatement"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Test + @TestMetadata("WhileStatement.kt") + public void testWhileStatement() { + runTest("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/whilestatement/WhileStatement.kt"); + } + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/.idea") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class _idea { + @Test + public void testAllFilesPresentIn_idea() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/.idea"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @Nested + @TestMetadata("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/.idea/libraries") + @TestDataPath("$PROJECT_ROOT") + @Tag("es6") + public class Libraries { + @Test + public void testAllFilesPresentInLibraries() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("/Users/Artem.Kobzar/Projects/jetbrains/kotlin-js-inner-stand/.idea/libraries"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + } +}
diff --git a/js/js.translator/testData/_commonFiles/box.kt b/js/js.translator/testData/_commonFiles/box.kt new file mode 100644 index 0000000..52a130a --- /dev/null +++ b/js/js.translator/testData/_commonFiles/box.kt
@@ -0,0 +1 @@ +fun box() = "OK" \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditional.kt b/js/js.translator/testData/_commonFiles/closureAdditional.kt new file mode 100644 index 0000000..004ed65 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditional.kt
@@ -0,0 +1,31 @@ +package kotlin + +import kotlin.reflect.KClass + +public typealias Cloneable = Any +public typealias Void = Unit +public typealias Object = Any +public typealias Class<T> = kotlin.reflect.KClass<T> + +inline operator fun Int.Companion.invoke(value: Number) = value.toInt() +inline operator fun String.Companion.invoke(value: String) = value + +inline fun Number.intValue() = toInt() + +fun String.equalsIgnoreCase(other: String) = + equals(other) + +fun assert(value: Boolean, fn: () -> Any = { "Assertion Exception" }) { + if (!value) throw Throwable(fn().toString()) +} + +inline fun <T> synchronized(value: Any?, fn: () -> T) = fn() + + +val <T> KClass<T>.java: KClass<T> inline get() = this +val <T> KClass<T>.javaPrimitiveType: KClass<T> inline get() = this +val <T> KClass<T>.javaObjectType: KClass<T> inline get() = this.js + +val Any.javaClass inline get() = this::class.js + +fun <T> Any.isArrayOf() = false \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJava.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJava.kt new file mode 100644 index 0000000..e4831b9 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJava.kt
@@ -0,0 +1,30 @@ +package java.lang + +interface AutoCloseable { + fun close() +} + +open class ClassCastException : Throwable() +open class RuntimeException : Throwable() +open class AssertionError : Throwable() +open class Error : Throwable() + +typealias Exception = kotlin.Exception +typealias String = kotlin.String +typealias Number = kotlin.Number +typealias Comparable<T> = kotlin.Comparable<T> +typealias Class<T> = kotlin.reflect.KClass<*> +typealias Void = Unit + +object Long { + fun valueOf(value: kotlin.Long): kotlin.Long = value +} + +object Byte { + fun valueOf(value: kotlin.Byte): kotlin.Byte = value +} + +object System { + fun getProperty(key: String, defaultValue: String? = null): String? = + defaultValue +} \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJavaAnnotation.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJavaAnnotation.kt new file mode 100644 index 0000000..e3bff91 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJavaAnnotation.kt
@@ -0,0 +1,5 @@ +package java.lang.annotation + +typealias Annotation = kotlin.Annotation + +fun Annotation.annotationType(): dynamic = js("({})") \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulInternal.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulInternal.kt new file mode 100644 index 0000000..d944175 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulInternal.kt
@@ -0,0 +1,5 @@ +package javaemul.internal + +object Exceptions { + fun safeClose(closable: Any?, exception: Throwable?): Throwable? = null +}
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulLang.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulLang.kt new file mode 100644 index 0000000..7eec460 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJavaEmulLang.kt
@@ -0,0 +1,5 @@ +package javaemul.lang + +open class J2ktMonitor { + +} \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtil.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtil.kt new file mode 100644 index 0000000..95c9627 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtil.kt
@@ -0,0 +1,9 @@ +package java.util + +typealias ArrayList<T> = kotlin.collections.ArrayList<T> + +class Optional<T>(private val value: T?) { + companion object { + fun <T> of(value: T) = Optional(value) + } +} \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtilFunction.kt b/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtilFunction.kt new file mode 100644 index 0000000..c62aa81 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalJavaUtilFunction.kt
@@ -0,0 +1,5 @@ +package java.util.function +package java.util.function + +typealias Consumer<T> = (T) -> Any? +typealias Function<A, B> = (A) -> B \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureAdditionalKotlinJvm.kt b/js/js.translator/testData/_commonFiles/closureAdditionalKotlinJvm.kt new file mode 100644 index 0000000..e5d4256 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureAdditionalKotlinJvm.kt
@@ -0,0 +1,5 @@ +package kotlin.jvm + +import kotlin.reflect.KClass + +val KClass<*>.javaObjectType = Any::class \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureJavaIo.kt b/js/js.translator/testData/_commonFiles/closureJavaIo.kt new file mode 100644 index 0000000..483d22f --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureJavaIo.kt
@@ -0,0 +1,3 @@ +package java.io + +typealias Serializable = Any \ No newline at end of file
diff --git a/js/js.translator/testData/_commonFiles/closureTypeAnnotations.kt b/js/js.translator/testData/_commonFiles/closureTypeAnnotations.kt new file mode 100644 index 0000000..953d3b8 --- /dev/null +++ b/js/js.translator/testData/_commonFiles/closureTypeAnnotations.kt
@@ -0,0 +1,3 @@ +package typeannotations + +interface ParametricType<T> \ No newline at end of file