diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index b7c94869377..b402806cd78 100755 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -1173,7 +1173,7 @@ fun main(args: Array) { } } - generateTestDataForReservedWords() + //generateTestDataForReservedWords() testGroup("js/js.tests/test", "js/js.translator/testData") { testClass() { diff --git a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/JsInliner.java b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/JsInliner.java index df26d1b2915..bb57336e53e 100644 --- a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/JsInliner.java +++ b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/JsInliner.java @@ -64,7 +64,7 @@ public class JsInliner extends JsVisitorWithContextImpl { public static JsProgram process(@NotNull TranslationContext context) { JsProgram program = context.program(); - IdentityHashMap functions = CollectUtilsKt.collectNamedFunctions(program); + Map functions = CollectUtilsKt.collectNamedFunctions(program); JsInliner inliner = new JsInliner(functions, new FunctionReader(context), context.bindingTrace()); inliner.accept(program); RemoveUnusedFunctionDefinitionsKt.removeUnusedFunctionDefinitions(program, functions); diff --git a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectUtils.kt b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectUtils.kt index 511742546ad..a58e9b1fcf3 100644 --- a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectUtils.kt +++ b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectUtils.kt @@ -22,6 +22,7 @@ import com.google.dart.compiler.backend.js.ast.metadata.staticRef import org.jetbrains.kotlin.js.inline.util.collectors.InstanceCollector import org.jetbrains.kotlin.js.inline.util.collectors.PropertyCollector import org.jetbrains.kotlin.js.translate.expression.* +import org.jetbrains.kotlin.js.translate.utils.JsAstUtils import java.util.* fun collectFunctionReferencesInside(scope: JsNode): List = @@ -133,19 +134,54 @@ fun collectJsProperties(scope: JsNode): IdentityHashMap { return collector.properties } -fun collectNamedFunctions(scope: JsNode): IdentityHashMap { - val namedFunctions = IdentityHashMap() +fun collectNamedFunctions(scope: JsNode) = collectNamedFunctionsAndMetadata(scope).mapValues { it.value.first } - for ((name, value) in collectJsProperties(scope)) { - val function: JsFunction? = when (value) { - is JsFunction -> value - else -> InlineMetadata.decompose(value)?.function +fun collectNamedFunctionsOrMetadata(scope: JsNode) = collectNamedFunctionsAndMetadata(scope).mapValues { it.value.second } + +fun collectNamedFunctionsAndMetadata(scope: JsNode): Map> { + val namedFunctions = mutableMapOf>() + + scope.accept(object : RecursiveJsVisitor() { + override fun visitBinaryExpression(x: JsBinaryOperation) { + val assignment = JsAstUtils.decomposeAssignment(x) + if (assignment != null) { + val (left, right) = assignment + if (left is JsNameRef) { + val name = left.name + val function = extractFunction(right) + if (function != null && name != null) { + namedFunctions[name] = Pair(function, right) + } + } + } + super.visitBinaryExpression(x) } - if (function != null) { - namedFunctions[name] = function + override fun visit(x: JsVars.JsVar) { + val initializer = x.initExpression + val name = x.name + if (initializer != null && name != null) { + val function = extractFunction(initializer) + if (function != null) { + namedFunctions[name] = Pair(function, initializer) + } + } + super.visit(x) } - } + + override fun visitFunction(x: JsFunction) { + val name = x.name + if (name != null) { + namedFunctions[name] = Pair(x, x) + } + super.visitFunction(x) + } + + private fun extractFunction(expression: JsExpression) = when (expression) { + is JsFunction -> expression + else -> InlineMetadata.decompose(expression)?.function + } + }) return namedFunctions } diff --git a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectors/PropertyCollector.kt b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectors/PropertyCollector.kt index 49127653b22..5049cfbf90c 100644 --- a/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectors/PropertyCollector.kt +++ b/js/js.inliner/src/org/jetbrains/kotlin/js/inline/util/collectors/PropertyCollector.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.js.inline.util.collectors import com.google.dart.compiler.backend.js.ast.* import org.jetbrains.kotlin.js.translate.expression.InlineMetadata +import org.jetbrains.kotlin.js.translate.utils.JsAstUtils import java.util.IdentityHashMap diff --git a/js/js.libraries/src/core/exceptions.kt b/js/js.libraries/src/core/exceptions.kt index 57dbb7289f4..45d33dcb963 100644 --- a/js/js.libraries/src/core/exceptions.kt +++ b/js/js.libraries/src/core/exceptions.kt @@ -16,9 +16,19 @@ package kotlin -open class Error(message: String? = null) : Throwable(message, null) {} +open class Error(message: String? = null) : Throwable(message, null) { + init { + val self: dynamic = this + self.message = message + } +} -open class Exception(message: String? = null) : Throwable(message, null) {} +open class Exception(message: String? = null) : Throwable(message, null) { + init { + val self: dynamic = this + self.message = message + } +} open class RuntimeException(message: String? = null) : Exception(message) {} diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index cfe1a74d26f..85ebcdaf7b9 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -3403,7 +3403,7 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { } public void testAllFilesPresentInInterfaces() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inheritance/interfaces"), Pattern.compile("^([^_](.+))\\.kt$"), true); + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/inheritance/interfaces"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.ANY, true); } @TestMetadata("withDefaultMethod.kt") @@ -6468,1047 +6468,6 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { } } - @TestMetadata("js/js.translator/testData/box/reservedWords") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ReservedWords extends AbstractBoxJsTest { - public void testAllFilesPresentInReservedWords() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("js/js.translator/testData/box/reservedWords"), Pattern.compile("^([^_](.+))\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("dataClassValTypeof.kt") - public void testDataClassValTypeof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassValTypeof.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassValVar.kt") - public void testDataClassValVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassValVar.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassValWith.kt") - public void testDataClassValWith() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassValWith.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassValYield.kt") - public void testDataClassValYield() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassValYield.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassVarBreak.kt") - public void testDataClassVarBreak() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassVarBreak.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassVarInfinity.kt") - public void testDataClassVarInfinity() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassVarInfinity.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassVarKotlin.kt") - public void testDataClassVarKotlin() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassVarKotlin.kt"); - doTest(fileName); - } - - @TestMetadata("dataClassVarWhile.kt") - public void testDataClassVarWhile() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/dataClassVarWhile.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunDebugger.kt") - public void testDelegatedFunDebugger() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunDebugger.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunDefault.kt") - public void testDelegatedFunDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunDefault.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunIf.kt") - public void testDelegatedFunIf() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunIf.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunIn.kt") - public void testDelegatedFunIn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunIn.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunParamDelete.kt") - public void testDelegatedFunParamDelete() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunParamDelete.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunParamEnum.kt") - public void testDelegatedFunParamEnum() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunParamEnum.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunParamInterface.kt") - public void testDelegatedFunParamInterface() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunParamInterface.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedFunParamNull.kt") - public void testDelegatedFunParamNull() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedFunParamNull.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedLabelEval.kt") - public void testDelegatedLabelEval() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedLabelEval.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedLabelExport.kt") - public void testDelegatedLabelExport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedLabelExport.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedLabelPackage.kt") - public void testDelegatedLabelPackage() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedLabelPackage.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedLabelReturn.kt") - public void testDelegatedLabelReturn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedLabelReturn.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedValAwait.kt") - public void testDelegatedValAwait() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedValAwait.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedValCase.kt") - public void testDelegatedValCase() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedValCase.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedValDo.kt") - public void testDelegatedValDo() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedValDo.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedValElse.kt") - public void testDelegatedValElse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedValElse.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedVarCatch.kt") - public void testDelegatedVarCatch() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedVarCatch.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedVarConst.kt") - public void testDelegatedVarConst() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedVarConst.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedVarFalse.kt") - public void testDelegatedVarFalse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedVarFalse.kt"); - doTest(fileName); - } - - @TestMetadata("delegatedVarFor.kt") - public void testDelegatedVarFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/delegatedVarFor.kt"); - doTest(fileName); - } - - @TestMetadata("enumEntryContinue.kt") - public void testEnumEntryContinue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumEntryContinue.kt"); - doTest(fileName); - } - - @TestMetadata("enumEntryDo.kt") - public void testEnumEntryDo() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumEntryDo.kt"); - doTest(fileName); - } - - @TestMetadata("enumEntryPublic.kt") - public void testEnumEntryPublic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumEntryPublic.kt"); - doTest(fileName); - } - - @TestMetadata("enumEntryStatic.kt") - public void testEnumEntryStatic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumEntryStatic.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunImport.kt") - public void testEnumFunImport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunImport.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunInstanceof.kt") - public void testEnumFunInstanceof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunInstanceof.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunParamLet.kt") - public void testEnumFunParamLet() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunParamLet.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunParamNew.kt") - public void testEnumFunParamNew() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunParamNew.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunParamVar.kt") - public void testEnumFunParamVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunParamVar.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunParamWhile.kt") - public void testEnumFunParamWhile() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunParamWhile.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunTry.kt") - public void testEnumFunTry() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunTry.kt"); - doTest(fileName); - } - - @TestMetadata("enumFunTypeof.kt") - public void testEnumFunTypeof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumFunTypeof.kt"); - doTest(fileName); - } - - @TestMetadata("enumLabelBreak.kt") - public void testEnumLabelBreak() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumLabelBreak.kt"); - doTest(fileName); - } - - @TestMetadata("enumLabelClass.kt") - public void testEnumLabelClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumLabelClass.kt"); - doTest(fileName); - } - - @TestMetadata("enumLabelPrivate.kt") - public void testEnumLabelPrivate() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumLabelPrivate.kt"); - doTest(fileName); - } - - @TestMetadata("enumLabelProtected.kt") - public void testEnumLabelProtected() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumLabelProtected.kt"); - doTest(fileName); - } - - @TestMetadata("enumValExtends.kt") - public void testEnumValExtends() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumValExtends.kt"); - doTest(fileName); - } - - @TestMetadata("enumValFinally.kt") - public void testEnumValFinally() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumValFinally.kt"); - doTest(fileName); - } - - @TestMetadata("enumValSuper.kt") - public void testEnumValSuper() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumValSuper.kt"); - doTest(fileName); - } - - @TestMetadata("enumValThis.kt") - public void testEnumValThis() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumValThis.kt"); - doTest(fileName); - } - - @TestMetadata("enumVarFunction.kt") - public void testEnumVarFunction() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumVarFunction.kt"); - doTest(fileName); - } - - @TestMetadata("enumVarImplements.kt") - public void testEnumVarImplements() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumVarImplements.kt"); - doTest(fileName); - } - - @TestMetadata("enumVarThrow.kt") - public void testEnumVarThrow() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumVarThrow.kt"); - doTest(fileName); - } - - @TestMetadata("enumVarTrue.kt") - public void testEnumVarTrue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/enumVarTrue.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunArguments.kt") - public void testInsideClassFunArguments() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunArguments.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunAwait.kt") - public void testInsideClassFunAwait() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunAwait.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunParamCase.kt") - public void testInsideClassFunParamCase() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunParamCase.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunParamCatch.kt") - public void testInsideClassFunParamCatch() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunParamCatch.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunParamThrow.kt") - public void testInsideClassFunParamThrow() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunParamThrow.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunParamTrue.kt") - public void testInsideClassFunParamTrue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunParamTrue.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunSuper.kt") - public void testInsideClassFunSuper() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunSuper.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassFunThis.kt") - public void testInsideClassFunThis() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassFunThis.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassLabelConst.kt") - public void testInsideClassLabelConst() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassLabelConst.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassLabelDebugger.kt") - public void testInsideClassLabelDebugger() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassLabelDebugger.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassLabelTry.kt") - public void testInsideClassLabelTry() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassLabelTry.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassLabelTypeof.kt") - public void testInsideClassLabelTypeof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassLabelTypeof.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunContinue.kt") - public void testInsideClassObjectFunContinue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunContinue.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunDo.kt") - public void testInsideClassObjectFunDo() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunDo.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunExport.kt") - public void testInsideClassObjectFunExport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunExport.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunExtends.kt") - public void testInsideClassObjectFunExtends() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunExtends.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunParamElse.kt") - public void testInsideClassObjectFunParamElse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunParamElse.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunParamFalse.kt") - public void testInsideClassObjectFunParamFalse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFalse.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunParamFinally.kt") - public void testInsideClassObjectFunParamFinally() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFinally.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectFunParamFunction.kt") - public void testInsideClassObjectFunParamFunction() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFunction.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectLabelFor.kt") - public void testInsideClassObjectLabelFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectLabelFor.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectLabelIf.kt") - public void testInsideClassObjectLabelIf() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectLabelIf.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectLabelImplements.kt") - public void testInsideClassObjectLabelImplements() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectLabelImplements.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectLabelImport.kt") - public void testInsideClassObjectLabelImport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectLabelImport.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectValDefault.kt") - public void testInsideClassObjectValDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectValDefault.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectValDelete.kt") - public void testInsideClassObjectValDelete() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectValDelete.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectValVar.kt") - public void testInsideClassObjectValVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectValVar.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectValWhile.kt") - public void testInsideClassObjectValWhile() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectValWhile.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectVarBreak.kt") - public void testInsideClassObjectVarBreak() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectVarBreak.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectVarClass.kt") - public void testInsideClassObjectVarClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectVarClass.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectVarEnum.kt") - public void testInsideClassObjectVarEnum() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectVarEnum.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassObjectVarEval.kt") - public void testInsideClassObjectVarEval() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassObjectVarEval.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassValInfinity.kt") - public void testInsideClassValInfinity() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassValInfinity.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassValInterface.kt") - public void testInsideClassValInterface() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassValInterface.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassValNull.kt") - public void testInsideClassValNull() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassValNull.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassValYield.kt") - public void testInsideClassValYield() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassValYield.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassVarKotlin.kt") - public void testInsideClassVarKotlin() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassVarKotlin.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassVarNaN.kt") - public void testInsideClassVarNaN() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassVarNaN.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassVarPackage.kt") - public void testInsideClassVarPackage() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassVarPackage.kt"); - doTest(fileName); - } - - @TestMetadata("insideClassVarReturn.kt") - public void testInsideClassVarReturn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideClassVarReturn.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunParamStatic.kt") - public void testInsideObjectFunParamStatic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunParamStatic.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunParamSwitch.kt") - public void testInsideObjectFunParamSwitch() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunParamSwitch.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunParamThis.kt") - public void testInsideObjectFunParamThis() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunParamThis.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunParamThrow.kt") - public void testInsideObjectFunParamThrow() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunParamThrow.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunProtected.kt") - public void testInsideObjectFunProtected() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunProtected.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunPublic.kt") - public void testInsideObjectFunPublic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunPublic.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunReturn.kt") - public void testInsideObjectFunReturn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunReturn.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectFunSuper.kt") - public void testInsideObjectFunSuper() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectFunSuper.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectLabelTrue.kt") - public void testInsideObjectLabelTrue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectLabelTrue.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectLabelTry.kt") - public void testInsideObjectLabelTry() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectLabelTry.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectLabelUndefined.kt") - public void testInsideObjectLabelUndefined() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectLabelUndefined.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectLabelVoid.kt") - public void testInsideObjectLabelVoid() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectLabelVoid.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectValIn.kt") - public void testInsideObjectValIn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectValIn.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectValInstanceof.kt") - public void testInsideObjectValInstanceof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectValInstanceof.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectValInterface.kt") - public void testInsideObjectValInterface() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectValInterface.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectValLet.kt") - public void testInsideObjectValLet() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectValLet.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectVarNew.kt") - public void testInsideObjectVarNew() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectVarNew.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectVarNull.kt") - public void testInsideObjectVarNull() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectVarNull.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectVarPackage.kt") - public void testInsideObjectVarPackage() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectVarPackage.kt"); - doTest(fileName); - } - - @TestMetadata("insideObjectVarPrivate.kt") - public void testInsideObjectVarPrivate() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/insideObjectVarPrivate.kt"); - doTest(fileName); - } - - @TestMetadata("localCatchIf.kt") - public void testLocalCatchIf() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localCatchIf.kt"); - doTest(fileName); - } - - @TestMetadata("localCatchIn.kt") - public void testLocalCatchIn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localCatchIn.kt"); - doTest(fileName); - } - - @TestMetadata("localCatchVoid.kt") - public void testLocalCatchVoid() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localCatchVoid.kt"); - doTest(fileName); - } - - @TestMetadata("localCatchWith.kt") - public void testLocalCatchWith() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localCatchWith.kt"); - doTest(fileName); - } - - @TestMetadata("localFunClass.kt") - public void testLocalFunClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunClass.kt"); - doTest(fileName); - } - - @TestMetadata("localFunContinue.kt") - public void testLocalFunContinue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunContinue.kt"); - doTest(fileName); - } - - @TestMetadata("localFunParamDo.kt") - public void testLocalFunParamDo() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunParamDo.kt"); - doTest(fileName); - } - - @TestMetadata("localFunParamElse.kt") - public void testLocalFunParamElse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunParamElse.kt"); - doTest(fileName); - } - - @TestMetadata("localFunParamPublic.kt") - public void testLocalFunParamPublic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunParamPublic.kt"); - doTest(fileName); - } - - @TestMetadata("localFunParamStatic.kt") - public void testLocalFunParamStatic() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunParamStatic.kt"); - doTest(fileName); - } - - @TestMetadata("localFunPrivate.kt") - public void testLocalFunPrivate() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunPrivate.kt"); - doTest(fileName); - } - - @TestMetadata("localFunProtected.kt") - public void testLocalFunProtected() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localFunProtected.kt"); - doTest(fileName); - } - - @TestMetadata("localLabelFalse.kt") - public void testLocalLabelFalse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localLabelFalse.kt"); - doTest(fileName); - } - - @TestMetadata("localLabelFor.kt") - public void testLocalLabelFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localLabelFor.kt"); - doTest(fileName); - } - - @TestMetadata("localLabelSwitch.kt") - public void testLocalLabelSwitch() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localLabelSwitch.kt"); - doTest(fileName); - } - - @TestMetadata("localLabelUndefined.kt") - public void testLocalLabelUndefined() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localLabelUndefined.kt"); - doTest(fileName); - } - - @TestMetadata("localValImport.kt") - public void testLocalValImport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localValImport.kt"); - doTest(fileName); - } - - @TestMetadata("localValInstanceof.kt") - public void testLocalValInstanceof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localValInstanceof.kt"); - doTest(fileName); - } - - @TestMetadata("localValTypeof.kt") - public void testLocalValTypeof() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localValTypeof.kt"); - doTest(fileName); - } - - @TestMetadata("localValVar.kt") - public void testLocalValVar() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localValVar.kt"); - doTest(fileName); - } - - @TestMetadata("localVarBreak.kt") - public void testLocalVarBreak() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localVarBreak.kt"); - doTest(fileName); - } - - @TestMetadata("localVarLet.kt") - public void testLocalVarLet() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localVarLet.kt"); - doTest(fileName); - } - - @TestMetadata("localVarNew.kt") - public void testLocalVarNew() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localVarNew.kt"); - doTest(fileName); - } - - @TestMetadata("localVarWhile.kt") - public void testLocalVarWhile() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/localVarWhile.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelClassDelete.kt") - public void testToplevelClassDelete() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelClassDelete.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelClassEnum.kt") - public void testToplevelClassEnum() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelClassEnum.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelClassNull.kt") - public void testToplevelClassNull() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelClassNull.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelClassPackage.kt") - public void testToplevelClassPackage() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelClassPackage.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelEnumExtends.kt") - public void testToplevelEnumExtends() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelEnumExtends.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelEnumFinally.kt") - public void testToplevelEnumFinally() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelEnumFinally.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelEnumThis.kt") - public void testToplevelEnumThis() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelEnumThis.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelEnumThrow.kt") - public void testToplevelEnumThrow() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelEnumThrow.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunAwait.kt") - public void testToplevelFunAwait() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunAwait.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunCase.kt") - public void testToplevelFunCase() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunCase.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunElse.kt") - public void testToplevelFunElse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunElse.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunFalse.kt") - public void testToplevelFunFalse() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunFalse.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunParamCatch.kt") - public void testToplevelFunParamCatch() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunParamCatch.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunParamConst.kt") - public void testToplevelFunParamConst() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunParamConst.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunParamFor.kt") - public void testToplevelFunParamFor() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunParamFor.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelFunParamIf.kt") - public void testToplevelFunParamIf() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelFunParamIf.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelInterfaceEval.kt") - public void testToplevelInterfaceEval() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelInterfaceEval.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelInterfaceExport.kt") - public void testToplevelInterfaceExport() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelInterfaceExport.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelInterfaceReturn.kt") - public void testToplevelInterfaceReturn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelInterfaceReturn.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelInterfaceSuper.kt") - public void testToplevelInterfaceSuper() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelInterfaceSuper.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelLabelDebugger.kt") - public void testToplevelLabelDebugger() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelLabelDebugger.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelLabelDefault.kt") - public void testToplevelLabelDefault() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelLabelDefault.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelLabelIn.kt") - public void testToplevelLabelIn() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelLabelIn.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelLabelInterface.kt") - public void testToplevelLabelInterface() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelLabelInterface.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelObjectFunction.kt") - public void testToplevelObjectFunction() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelObjectFunction.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelObjectImplements.kt") - public void testToplevelObjectImplements() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelObjectImplements.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelObjectTrue.kt") - public void testToplevelObjectTrue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelObjectTrue.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelObjectTry.kt") - public void testToplevelObjectTry() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelObjectTry.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelValBreak.kt") - public void testToplevelValBreak() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelValBreak.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelValClass.kt") - public void testToplevelValClass() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelValClass.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelValInfinity.kt") - public void testToplevelValInfinity() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelValInfinity.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelValKotlin.kt") - public void testToplevelValKotlin() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelValKotlin.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelVarArguments.kt") - public void testToplevelVarArguments() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelVarArguments.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelVarContinue.kt") - public void testToplevelVarContinue() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelVarContinue.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelVarDo.kt") - public void testToplevelVarDo() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelVarDo.kt"); - doTest(fileName); - } - - @TestMetadata("toplevelVarNaN.kt") - public void testToplevelVarNaN() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("js/js.translator/testData/box/reservedWords/toplevelVarNaN.kt"); - doTest(fileName); - } - } - @TestMetadata("js/js.translator/testData/box/rtti") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/AstSearchUtil.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/AstSearchUtil.java index 775af1d174b..6858b7bec3a 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/AstSearchUtil.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/AstSearchUtil.java @@ -22,6 +22,7 @@ import com.google.dart.compiler.backend.js.ast.JsName; import com.google.dart.compiler.backend.js.ast.JsNode; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.js.inline.util.CollectUtilsKt; import java.util.Map; @@ -43,6 +44,13 @@ public class AstSearchUtil { return property; } + @NotNull + public static JsExpression getMetadataOrFunction(@NotNull JsNode searchRoot, @NotNull String name) { + JsExpression property = findByIdent(CollectUtilsKt.collectNamedFunctionsOrMetadata(searchRoot), name); + assert property != null: "Property `" + name + "` was not found"; + return property; + } + @Nullable private static T findByIdent(@NotNull Map properties, @NotNull String name) { for (Map.Entry entry : properties.entrySet()) { diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/DirectiveTestUtils.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/DirectiveTestUtils.java index 2259b4179b9..a535a1256b7 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/DirectiveTestUtils.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/DirectiveTestUtils.java @@ -94,7 +94,7 @@ public class DirectiveTestUtils { @NotNull String getFunctionCode(@NotNull JsNode ast, @NotNull String functionName) { JsFunction function = AstSearchUtil.getFunction(ast, functionName); - return function.toString(); + return function.getBody().toString(); } @NotNull @@ -213,7 +213,7 @@ public class DirectiveTestUtils { @Override void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception { String functionName = arguments.getPositionalArgument(0); - JsExpression property = AstSearchUtil.getProperty(ast, functionName); + JsExpression property = AstSearchUtil.getMetadataOrFunction(ast, functionName); String message = "Inline metadata has not been generated for function " + functionName; assertNotNull(message, InlineMetadata.decompose(property)); } @@ -223,7 +223,7 @@ public class DirectiveTestUtils { @Override void processEntry(@NotNull JsNode ast, @NotNull ArgumentsHelper arguments) throws Exception { String functionName = arguments.getPositionalArgument(0); - JsExpression property = AstSearchUtil.getProperty(ast, functionName); + JsExpression property = AstSearchUtil.getMetadataOrFunction(ast, functionName); String message = "Inline metadata has been generated for not effectively public function " + functionName; assertTrue(message, property instanceof JsFunction); } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/CallInfoExtensions.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/CallInfoExtensions.kt index f595e3c1c9c..fc2fbf7848d 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/CallInfoExtensions.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/CallInfoExtensions.kt @@ -49,7 +49,7 @@ fun CallInfo.isSuperInvocation(): Boolean { val CallInfo.calleeOwner: JsExpression get() { val calleeOwner = resolvedCall.resultingDescriptor.containingDeclaration - return ReferenceTranslator.translateAsFQReference(calleeOwner, context) + return ReferenceTranslator.translateAsValueReference(calleeOwner, context) } val VariableAccessInfo.variableDescriptor: VariableDescriptor diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/FunctionCallCases.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/FunctionCallCases.kt index 45145eb7fde..abd3817dfdc 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/FunctionCallCases.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/FunctionCallCases.kt @@ -81,7 +81,7 @@ object DefaultFunctionCallCase : FunctionCallCase() { return JsInvocation(JsNameRef(context.getNameForDescriptor(callableDescriptor)), argumentsInfo.translateArguments) } - val functionRef = ReferenceTranslator.translateAsFQReference(callableDescriptor, context) + val functionRef = ReferenceTranslator.translateAsValueReference(callableDescriptor, context) return JsInvocation(functionRef, argumentsInfo.translateArguments) } @@ -101,7 +101,7 @@ object DefaultFunctionCallCase : FunctionCallCase() { return JsInvocation(JsNameRef(functionName, extensionReceiver), argumentsInfo.translateArguments) } - val functionRef = ReferenceTranslator.translateAsFQReference(callableDescriptor, context) + val functionRef = ReferenceTranslator.translateAsValueReference(callableDescriptor, context) val referenceToCall = if (callableDescriptor.visibility == Visibilities.LOCAL) { @@ -212,7 +212,7 @@ object ConstructorCallCase : FunctionCallCase() { private inline fun FunctionCallInfo.doTranslate( getArguments: CallArgumentTranslator.ArgumentsInfo.() -> List ): JsExpression { - val functionRef = ReferenceTranslator.translateAsFQReference(callableDescriptor, context) + val functionRef = ReferenceTranslator.translateAsValueReference(callableDescriptor, context) val invocationArguments = mutableListOf() val constructorDescriptor = callableDescriptor as ClassConstructorDescriptor diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/VariableCallCases.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/VariableCallCases.kt index e738ffdd126..3d331051424 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/VariableCallCases.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/callTranslator/VariableCallCases.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor import org.jetbrains.kotlin.js.translate.context.Namer import org.jetbrains.kotlin.js.translate.context.Namer.getCapturedVarAccessor +import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator import org.jetbrains.kotlin.js.translate.utils.JsAstUtils import org.jetbrains.kotlin.js.translate.utils.JsAstUtils.pureFqn import org.jetbrains.kotlin.js.translate.utils.JsDescriptorUtils @@ -84,17 +85,7 @@ object DefaultVariableAccessCase : VariableAccessCase() { return JsInvocation(pureFqn(context.getNameForObjectInstance (descriptor.getReferencedObject()), null)) } - val functionRef = context.aliasOrValue(callableDescriptor) { - if (context.isFromCurrentModule(variableDescriptor)) { - context.getInnerReference(variableDescriptor) - } - else { - val qualifier = context.getInnerReference(variableDescriptor.containingDeclaration) - val name = context.getNameForDescriptor(variableDescriptor) - JsNameRef(name, qualifier) - } - } - + val functionRef = ReferenceTranslator.translateAsValueReference(callableDescriptor, context) val ref = if (isVarCapturedInClosure(context.bindingContext(), callableDescriptor)) { getCapturedVarAccessor(functionRef) } @@ -170,7 +161,8 @@ object SuperPropertyAccessCase : VariableAccessCase() { return if (descriptor is PropertyDescriptor && TranslationUtils.shouldAccessViaFunctions(descriptor)) { val accessor = getAccessDescriptorIfNeeded() - val prototype = pureFqn(Namer.getPrototypeName(), context.getInnerReference(descriptor.containingDeclaration)) + val containingRef = ReferenceTranslator.translateAsValueReference(descriptor.containingDeclaration, context) + val prototype = pureFqn(Namer.getPrototypeName(), containingRef) val funRef = Namer.getFunctionCallRef(pureFqn(context.getNameForDescriptor(accessor), prototype)) val arguments = listOf(dispatchReceiver!!) + additionalArguments JsInvocation(funRef, *arguments.toTypedArray()) diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/StaticContext.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/StaticContext.java index 95e41e59b02..1fa7a925f62 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/StaticContext.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/StaticContext.java @@ -153,6 +153,9 @@ public final class StaticContext { @NotNull private final JsObjectLiteral exportObject = rootPackage.objectLiteral; + @NotNull + private final Set exportedDeclarations = new HashSet(); + //TODO: too many parameters in constructor private StaticContext( @NotNull JsProgram program, @@ -527,7 +530,9 @@ public final class StaticContext { return null; } if (getSuperclass((ClassDescriptor) descriptor) == null) { - return rootFunction.getScope(); + JsFunction function = new JsFunction(rootFunction.getScope(), new JsBlock(), descriptor.toString()); + scopeToFunction.put(function.getScope(), function); + return function.getScope(); } return null; } @@ -555,8 +560,7 @@ public final class StaticContext { Rule generateInnerScopesForMembers = new Rule() { @Override public JsScope apply(@NotNull DeclarationDescriptor descriptor) { - JsScope enclosingScope = getEnclosingScope(descriptor); - return enclosingScope.innerObjectScope("Scope for member " + descriptor.getName()); + return rootFunction.getScope().innerObjectScope("Scope for member " + descriptor.getName()); } }; Rule createFunctionObjectsForCallableDescriptors = new Rule() { @@ -659,27 +663,40 @@ public final class StaticContext { classes.add(classDescriptor); } - public void export(@NotNull DeclarationDescriptor descriptor) { - DeclarationDescriptor container = descriptor.getContainingDeclaration(); - if (descriptor instanceof ConstructorDescriptor) { - ConstructorDescriptor constructor = (ConstructorDescriptor) descriptor; - container = constructor.getConstructedClass().getContainingDeclaration(); - } - if (!(container instanceof PackageFragmentDescriptor)) { - throw new IllegalArgumentException("Declaration " + descriptor + " is not a top-level declaration"); - } + public void export(@NotNull MemberDescriptor descriptor, boolean force) { + if (exportedDeclarations.contains(descriptor)) return; - PackageFragmentDescriptor packageDescriptor = (PackageFragmentDescriptor) container; - ExportedPackage exportedPackage = rootPackage; - for (Name packageName : packageDescriptor.getFqName().pathSegments()) { - exportedPackage = exportedPackage.getSubpackage(packageName.asString()); - } + if (descriptor instanceof ConstructorDescriptor && ((ConstructorDescriptor) descriptor).isPrimary()) return; - JsExpression initializerExpr = DeclarationExporter.exportDeclaration(this, descriptor, exportStatements); - if (initializerExpr != null) { - JsPropertyInitializer initializer = new JsPropertyInitializer( - getNameForDescriptor(descriptor).makeRef(), initializerExpr); - exportedPackage.objectLiteral.getPropertyInitializers().add(initializer); + SuggestedName suggestedName = nameSuggestion.suggest(descriptor); + if (suggestedName == null) return; + + DeclarationDescriptor container = suggestedName.getScope(); + if (!DeclarationExporter.shouldBeExported(descriptor, force)) return; + exportedDeclarations.add(descriptor); + + if (container instanceof PackageFragmentDescriptor) { + PackageFragmentDescriptor packageDescriptor = (PackageFragmentDescriptor) container; + ExportedPackage exportedPackage = rootPackage; + for (Name packageName : packageDescriptor.getFqName().pathSegments()) { + exportedPackage = exportedPackage.getSubpackage(packageName.asString()); + } + + JsExpression initializerExpr = DeclarationExporter.exportDeclaration(this, descriptor, exportStatements); + if (initializerExpr != null) { + JsName propertyName = getNameForDescriptor(descriptor); + if (MetadataProperties.getStaticRef(propertyName) == null) { + if (!(initializerExpr instanceof JsNameRef) || ((JsNameRef) initializerExpr).getName() != propertyName) { + MetadataProperties.setStaticRef(propertyName, initializerExpr); + } + } + JsPropertyInitializer initializer = new JsPropertyInitializer(propertyName.makeRef(), initializerExpr); + exportedPackage.objectLiteral.getPropertyInitializers().add(initializer); + } + } + else { + JsExpression initializerExpr = DeclarationExporter.exportDeclaration(this, descriptor, exportStatements); + assert initializerExpr == null : "Should not produce initializer for non-package declaration"; } } @@ -698,11 +715,12 @@ public final class StaticContext { rootFunction.getBody().getStatements().addAll(importStatements); addClassPrototypes(); rootFunction.getBody().getStatements().addAll(declarationStatements); - rootFunction.getBody().getStatements().addAll(topLevelStatements); JsName rootPackageName = rootFunction.getScope().declareName(Namer.getRootPackageName()); rootFunction.getBody().getStatements().add(JsAstUtils.newVar(rootPackageName, exportObject)); rootFunction.getBody().getStatements().addAll(exportStatements); + + rootFunction.getBody().getStatements().addAll(topLevelStatements); } private void addClassPrototypes() { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/TranslationContext.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/TranslationContext.java index 202d21393f3..d8396097622 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/TranslationContext.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/TranslationContext.java @@ -236,6 +236,9 @@ public class TranslationContext { @NotNull public JsNameRef getQualifiedReference(@NotNull DeclarationDescriptor descriptor) { + if (descriptor instanceof MemberDescriptor && isFromCurrentModule(descriptor) && isPublicInlineFunction()) { + staticContext.export((MemberDescriptor) descriptor, true); + } return staticContext.getQualifiedReference(descriptor); } @@ -608,14 +611,20 @@ public class TranslationContext { staticContext.addClass(classDescriptor); } - public void export(@NotNull DeclarationDescriptor descriptor) { - staticContext.export(descriptor); + public void export(@NotNull MemberDescriptor descriptor) { + staticContext.export(descriptor, false); } public boolean isFromCurrentModule(@NotNull DeclarationDescriptor descriptor) { return staticContext.getCurrentModule() == DescriptorUtilsKt.getModule(descriptor); } + public boolean isPublicInlineFunction() { + if (!(declarationDescriptor instanceof FunctionDescriptor)) return false; + FunctionDescriptor function = (FunctionDescriptor) declarationDescriptor; + return function.isInline() && DescriptorUtilsKt.isEffectivelyPublicApi(function); + } + @NotNull public ModuleDescriptor getCurrentModule() { return staticContext.getCurrentModule(); diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/exportDeclaration.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/exportDeclaration.kt index 92b8625decd..47636d4ec69 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/exportDeclaration.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/context/exportDeclaration.kt @@ -19,39 +19,81 @@ package org.jetbrains.kotlin.js.translate.context import com.google.dart.compiler.backend.js.ast.* import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.js.translate.utils.AnnotationsUtils import org.jetbrains.kotlin.js.translate.utils.JsAstUtils import org.jetbrains.kotlin.js.translate.utils.JsDescriptorUtils +import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyPublicApi -fun StaticContext.exportDeclaration(declaration: DeclarationDescriptor, additionalStatements: MutableList): JsExpression? { +// TODO: refactor +fun StaticContext.exportDeclaration(declaration: MemberDescriptor, additionalStatements: MutableList): JsExpression? { + val scope = nameSuggestion.suggest(declaration)!!.scope return when { - declaration is ClassDescriptor && declaration.kind == ClassKind.OBJECT -> { - exportObject(declaration, additionalStatements) - null + declaration is ClassDescriptor -> when { + declaration.kind == ClassKind.OBJECT || declaration.kind == ClassKind.ENUM_ENTRY -> { + exportObject(declaration, scope, additionalStatements) + null + } + scope is ClassDescriptor -> { + exportNested(declaration, scope, additionalStatements) + null + } + else -> { + getInnerNameForDescriptor(declaration).makeRef() + } } declaration is PropertyDescriptor -> { - exportProperty(declaration, additionalStatements) + if (scope is PackageFragmentDescriptor) { + exportProperty(declaration, scope, additionalStatements) + } null } - else -> { + scope is PackageFragmentDescriptor -> { getInnerNameForDescriptor(declaration).makeRef() } + + else -> null } } -private fun StaticContext.exportObject(declaration: ClassDescriptor, additionalStatements: MutableList) { - val suggestedName = nameSuggestion.suggest(declaration)!! - val qualifier = getQualifiedReference(suggestedName.scope) +fun MemberDescriptor.shouldBeExported(force: Boolean) = + force || isEffectivelyPublicApi || AnnotationsUtils.getJsNameAnnotation(this) != null + +private fun StaticContext.exportNested( + descriptor: ClassDescriptor, + scope: ClassDescriptor, + additionalStatements: MutableList +) { + val qualifier = getBaseReference(scope) + val reference = JsAstUtils.pureFqn(getNameForDescriptor(descriptor), qualifier) + val instanceRef = JsAstUtils.pureFqn(getInnerNameForDescriptor(descriptor), null) + additionalStatements += JsAstUtils.assignment(reference, instanceRef).makeStmt() +} + +private fun StaticContext.exportObject( + declaration: ClassDescriptor, + scope: DeclarationDescriptor, + additionalStatements: MutableList +) { + val qualifier = getBaseReference(scope) val name = getNameForDescriptor(declaration) additionalStatements += JsAstUtils.defineGetter(program, qualifier, name.ident, getNameForObjectInstance(declaration).makeRef()) } -private fun StaticContext.exportProperty(declaration: PropertyDescriptor, additionalStatements: MutableList) { +private fun StaticContext.getBaseReference(declaration: DeclarationDescriptor) = when (declaration) { + is PackageFragmentDescriptor -> getQualifiedReference(declaration) + else -> JsAstUtils.pureFqn(getInnerNameForDescriptor(declaration), null) +} + +private fun StaticContext.exportProperty( + declaration: PropertyDescriptor, + scope: DeclarationDescriptor, + additionalStatements: MutableList +) { val propertyLiteral = JsObjectLiteral(true) - val suggestedName = nameSuggestion.suggest(declaration)!! - val qualifier = getQualifiedReference(suggestedName.scope) + val qualifier = getBaseReference(scope) val name = getNameForDescriptor(declaration).ident val getterBody: JsExpression = if (JsDescriptorUtils.isSimpleFinalProperty(declaration)) { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/ClassTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/ClassTranslator.kt index c87cf9e8325..a47e213a200 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/ClassTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/ClassTranslator.kt @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.js.translate.context.* import org.jetbrains.kotlin.js.translate.expression.FunctionTranslator import org.jetbrains.kotlin.js.translate.general.AbstractTranslator import org.jetbrains.kotlin.js.translate.initializer.ClassInitializerTranslator +import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator import org.jetbrains.kotlin.js.translate.utils.* import org.jetbrains.kotlin.js.translate.utils.BindingUtils.getClassDescriptor import org.jetbrains.kotlin.js.translate.utils.BindingUtils.getPropertyDescriptorForConstructorParameter @@ -301,7 +302,7 @@ class ClassTranslator private constructor( val name = nonConstructorUsageTracker.getNameForCapturedDescriptor(it)!! JsAstUtils.pureFqn(name, closureQualifier) } - callSite.invocationArgs.addAll(0, closureArgs.toList()) + callSite.invocationArgs.addAll(0, closureArgs) } } } @@ -340,7 +341,7 @@ class ClassTranslator private constructor( if (supertypes.size == 1) { val type = supertypes[0] val supertypeDescriptor = getClassDescriptorForType(type) - return listOf(context().getInnerReference(supertypeDescriptor)) + return listOf(ReferenceTranslator.translateAsTypeReference(supertypeDescriptor, context())) } val supertypeConstructors = mutableSetOf() @@ -356,7 +357,7 @@ class ClassTranslator private constructor( for (typeConstructor in sortedAllSuperTypes) { if (supertypeConstructors.contains(typeConstructor)) { val supertypeDescriptor = getClassDescriptorForTypeConstructor(typeConstructor) - supertypesRefs += context().getInnerReference(supertypeDescriptor) + supertypesRefs += ReferenceTranslator.translateAsTypeReference(supertypeDescriptor, context()) } } return supertypesRefs diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DeclarationBodyVisitor.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DeclarationBodyVisitor.kt index a5850e50257..6e200525f3a 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DeclarationBodyVisitor.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DeclarationBodyVisitor.kt @@ -62,6 +62,7 @@ class DeclarationBodyVisitor( assert(supertypes.size == 1) { "Simple Enum entry must have one supertype" } val jsEnumEntryCreation = ClassInitializerTranslator .generateEnumEntryInstanceCreation(context, supertypes[0], enumEntry, enumEntryOrdinal) + context.addDeclarationStatement(JsAstUtils.newVar(enumInstanceName, jsEnumEntryCreation)) val jsEnumEntryFunction = context.createTopLevelAnonymousFunction(descriptor) jsEnumEntryFunction.body.statements.add(JsReturn(jsEnumEntryCreation)) @@ -69,12 +70,6 @@ class DeclarationBodyVisitor( enumInstanceFunction.name = context.getNameForObjectInstance(descriptor) context.addDeclarationStatement(enumInstanceFunction.makeStmt()) - val classRef = context.getInnerReference(descriptor.containingDeclaration) - val enumExtName = context.getNameForDescriptor(descriptor) - val enumExtFq = JsNameRef(enumExtName, classRef) - context.addDeclarationStatement(JsAstUtils.assignment(enumExtFq, enumInstanceFunction.name.makeRef()).makeStmt()) - - context.addDeclarationStatement(JsAstUtils.newVar(enumInstanceName, jsEnumEntryCreation)) enumInstanceFunction.body.statements.add(JsReturn(enumInstanceName.makeRef())) } @@ -92,7 +87,7 @@ class DeclarationBodyVisitor( } override fun addClass(descriptor: ClassDescriptor) { - //context.export(descriptor) + context.export(descriptor) } override fun addFunction(descriptor: FunctionDescriptor, expression: JsExpression) { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java index 798c1def743..d6498266698 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java @@ -518,9 +518,9 @@ public final class ExpressionVisitor extends TranslatorVisitor { @NotNull public JsNode visitObjectLiteralExpression(@NotNull KtObjectLiteralExpression expression, @NotNull TranslationContext context) { ClassDescriptor descriptor = BindingUtils.getClassDescriptor(context.bindingContext(), expression.getObjectDeclaration()); - translateClassOrObject(expression.getObjectDeclaration(), descriptor, context); + translateClassOrObject(expression.getObjectDeclaration(), descriptor, context); - JsExpression constructor = context.getInnerReference(descriptor); + JsExpression constructor = ReferenceTranslator.translateAsTypeReference(descriptor, context); List closure = context.getClassOrConstructorClosure(descriptor); List closureArgs = new ArrayList(); if (closure != null) { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LiteralFunctionTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LiteralFunctionTranslator.kt index 2926152e1d6..1b300df82de 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LiteralFunctionTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LiteralFunctionTranslator.kt @@ -21,7 +21,6 @@ import com.google.dart.compiler.backend.js.ast.metadata.* import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl import org.jetbrains.kotlin.js.inline.util.getInnerFunction -import org.jetbrains.kotlin.js.inline.util.refreshLabelNames import org.jetbrains.kotlin.js.translate.context.TranslationContext import org.jetbrains.kotlin.js.translate.context.getNameForCapturedDescriptor import org.jetbrains.kotlin.js.translate.context.hasCapturedExceptContaining @@ -73,12 +72,14 @@ class LiteralFunctionTranslator(context: TranslationContext) : AbstractTranslato if (!isRecursive) { lambda.name = null } + lambdaCreator.name.staticRef = lambdaCreator return lambdaCreator.withCapturedParameters(functionContext, invokingContext) } lambda.isLocal = true context().addDeclarationStatement(lambda.makeStmt()) + lambda.name.staticRef = lambda return lambda.name.makeRef().apply { sideEffects = SideEffectKind.PURE } } @@ -92,10 +93,7 @@ class LiteralFunctionTranslator(context: TranslationContext) : AbstractTranslato } } -fun JsFunction.withCapturedParameters( - context: TranslationContext, - invokingContext: TranslationContext -): JsExpression { +fun JsFunction.withCapturedParameters(context: TranslationContext, invokingContext: TranslationContext): JsExpression { context.addDeclarationStatement(makeStmt()) val ref = name.makeRef().apply { sideEffects = SideEffectKind.PURE } val invocation = JsInvocation(ref).apply { sideEffects = SideEffectKind.PURE } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/PatternTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/PatternTranslator.java index 5848a8d682f..21c3a47ccab 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/PatternTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/PatternTranslator.java @@ -32,6 +32,7 @@ import org.jetbrains.kotlin.js.translate.context.TranslationContext; import org.jetbrains.kotlin.js.translate.general.AbstractTranslator; import org.jetbrains.kotlin.js.translate.general.Translation; import org.jetbrains.kotlin.js.translate.intrinsic.functions.factories.TopLevelFIF; +import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator; import org.jetbrains.kotlin.js.translate.utils.BindingUtils; import org.jetbrains.kotlin.js.translate.utils.TranslationUtils; import org.jetbrains.kotlin.lexer.KtTokens; @@ -169,7 +170,7 @@ public final class PatternTranslator extends AbstractTranslator { ClassDescriptor referencedClass = DescriptorUtils.getClassDescriptorForType(type); - JsNameRef typeName = context().getInnerReference(referencedClass); + JsExpression typeName = ReferenceTranslator.translateAsTypeReference(referencedClass, context()); return referencedClass.getKind() != ClassKind.OBJECT ? namer().isInstanceOf(typeName) : namer().isInstanceOfObject(typeName); } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/intrinsic/functions/basic/FqnCallIntrinsic.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/intrinsic/functions/basic/FqnCallIntrinsic.kt index 884fb145605..d97ec665504 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/intrinsic/functions/basic/FqnCallIntrinsic.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/intrinsic/functions/basic/FqnCallIntrinsic.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.js.translate.intrinsic.functions.basic import com.google.dart.compiler.backend.js.ast.JsExpression import org.jetbrains.kotlin.js.translate.context.Namer import org.jetbrains.kotlin.js.translate.context.TranslationContext +import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator import org.jetbrains.kotlin.js.translate.utils.JsAstUtils import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter @@ -43,7 +44,7 @@ class FqnCallIntrinsic( JsAstUtils.replaceRootReference(context.getQualifiedReference(fqn), Namer.kotlinObject()) } else { - context.getInnerReference(descriptors.first()) + ReferenceTranslator.translateAsValueReference(descriptors.first(), context) } } } \ No newline at end of file diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/CallableReferenceTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/CallableReferenceTranslator.kt index 1d15738da05..4052dce66e4 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/CallableReferenceTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/CallableReferenceTranslator.kt @@ -63,7 +63,7 @@ object CallableReferenceTranslator { isMember(descriptor) -> translateForMemberFunction(descriptor, context) else -> - ReferenceTranslator.translateAsFQReference(descriptor, context) + ReferenceTranslator.translateAsValueReference(descriptor, context) } } @@ -108,14 +108,14 @@ object CallableReferenceTranslator { } private fun translateForExtensionProperty(descriptor: PropertyDescriptor, context: TranslationContext): JsExpression { - val jsGetterNameRef = context.getInnerReference(descriptor.getter!!) + val jsGetterNameRef = ReferenceTranslator.translateAsValueReference(descriptor.getter!!, context) val propertyName = descriptor.name val jsPropertyNameAsString = context.program().getStringLiteral(propertyName.asString()) val argumentList = ArrayList(3) argumentList.add(jsPropertyNameAsString) argumentList.add(jsGetterNameRef) if (descriptor.isVar) { - val jsSetterNameRef = context.getInnerReference(descriptor.setter!!) + val jsSetterNameRef = ReferenceTranslator.translateAsValueReference(descriptor.setter!!, context) argumentList.add(jsSetterNameRef) } return if (AnnotationsUtils.isNativeObject(descriptor)) @@ -125,7 +125,7 @@ object CallableReferenceTranslator { } private fun translateForConstructor(descriptor: FunctionDescriptor, context: TranslationContext): JsExpression { - val jsFunctionRef = ReferenceTranslator.translateAsFQReference(descriptor, context) + val jsFunctionRef = ReferenceTranslator.translateAsValueReference(descriptor, context) return JsInvocation(context.namer().callableRefForConstructorReference(), jsFunctionRef) } @@ -133,7 +133,7 @@ object CallableReferenceTranslator { val receiverParameterDescriptor = descriptor.extensionReceiverParameter ?: error("receiverParameter for extension should not be null") - val jsFunctionRef = ReferenceTranslator.translateAsFQReference(descriptor, context) + val jsFunctionRef = ReferenceTranslator.translateAsValueReference(descriptor, context) if (descriptor.visibility == Visibilities.LOCAL) { return JsInvocation(context.namer().callableRefForLocalExtensionFunctionReference(), jsFunctionRef) } @@ -159,12 +159,7 @@ object CallableReferenceTranslator { classDescriptor: ClassDescriptor, context: TranslationContext ): JsExpression { - val jsClassNameRef = if (AnnotationsUtils.isNativeObject(classDescriptor)) { - context.getQualifiedReference(classDescriptor) - } - else { - context.getInnerReference(classDescriptor) - } + val jsClassNameRef = ReferenceTranslator.translateAsTypeReference(classDescriptor, context) val funName = context.getNameForDescriptor(descriptor) val funNameAsString = context.program().getStringLiteral(funName.toString()) return JsInvocation(context.namer().callableRefForMemberFunctionReference(), jsClassNameRef, funNameAsString) diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceAccessTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceAccessTranslator.java index 7ce2f9f0195..afe122b2aa7 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceAccessTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceAccessTranslator.java @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.js.translate.general.AbstractTranslator; import org.jetbrains.kotlin.js.translate.utils.JsAstUtils; import org.jetbrains.kotlin.psi.KtSimpleNameExpression; -import static org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator.translateAsLocalNameReference; +import static org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator.translateAsValueReference; import static org.jetbrains.kotlin.js.translate.utils.BindingUtils.getDescriptorForReferenceExpression; public final class ReferenceAccessTranslator extends AbstractTranslator implements AccessTranslator { @@ -42,7 +42,7 @@ public final class ReferenceAccessTranslator extends AbstractTranslator implemen private ReferenceAccessTranslator(@NotNull DeclarationDescriptor descriptor, @NotNull TranslationContext context) { super(context); - this.reference = translateAsLocalNameReference(descriptor, context()); + this.reference = translateAsValueReference(descriptor, context()); } @Override diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceTranslator.java index 630ee0bde4d..08df8c33695 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/reference/ReferenceTranslator.java @@ -18,6 +18,11 @@ package org.jetbrains.kotlin.js.translate.reference; import com.google.dart.compiler.backend.js.ast.JsExpression; import com.google.dart.compiler.backend.js.ast.JsInvocation; +import com.google.dart.compiler.backend.js.ast.JsName; +import com.google.dart.compiler.backend.js.ast.JsNameRef; +import com.google.dart.compiler.backend.js.ast.metadata.HasMetadata; +import com.google.dart.compiler.backend.js.ast.metadata.MetadataProperties; +import com.google.dart.compiler.backend.js.ast.metadata.SideEffectKind; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.js.translate.context.TranslationContext; @@ -43,52 +48,85 @@ public final class ReferenceTranslator { } @NotNull - public static JsExpression translateAsFQReference(@NotNull DeclarationDescriptor referencedDescriptor, - @NotNull TranslationContext context) { - JsExpression alias = context.getAliasForDescriptor(referencedDescriptor); + public static JsExpression translateAsValueReference(@NotNull DeclarationDescriptor descriptor, @NotNull TranslationContext context) { + JsExpression alias = context.getAliasForDescriptor(descriptor); if (alias != null) return alias; - if (isLocalVarOrFunction(referencedDescriptor) || - AnnotationsUtils.isNativeObject(referencedDescriptor) || - AnnotationsUtils.isLibraryObject(referencedDescriptor) - ) { - return context.getQualifiedReference(referencedDescriptor); + if (shouldTranslateAsFQN(descriptor, context)) { + return context.getQualifiedReference(descriptor); } - return context.getInnerReference(referencedDescriptor); - } - - private static boolean isLocalVarOrFunction(DeclarationDescriptor descriptor) { - return descriptor.getContainingDeclaration() instanceof FunctionDescriptor && !(descriptor instanceof ClassDescriptor); - } - - @NotNull - public static JsExpression translateAsLocalNameReference(@NotNull DeclarationDescriptor descriptor, - @NotNull TranslationContext context) { - if (descriptor instanceof FunctionDescriptor || descriptor instanceof VariableDescriptor) { - JsExpression alias = context.getAliasForDescriptor(descriptor); - if (alias != null) { - return alias; + if (descriptor instanceof PropertyDescriptor) { + PropertyDescriptor property = (PropertyDescriptor) descriptor; + if (context.isFromCurrentModule(property)) { + return context.getInnerReference(property); + } + else { + JsExpression qualifier = context.getInnerReference(property.getContainingDeclaration()); + JsName name = context.getNameForDescriptor(property); + return new JsNameRef(name, qualifier); } } + if (DescriptorUtils.isObject(descriptor) || DescriptorUtils.isEnumEntry(descriptor)) { if (AnnotationsUtils.isNativeObject(descriptor)) { return context.getQualifiedReference(descriptor); } else if (!context.isFromCurrentModule(descriptor)) { - DeclarationDescriptor container = descriptor.getContainingDeclaration(); - assert container != null : "Object must have containing declaration: " + descriptor; - JsExpression qualifier = context.getInnerReference(container); - return JsAstUtils.pureFqn(context.getNameForDescriptor(descriptor), qualifier); + return getLazyReferenceToObject((ClassDescriptor) descriptor, context); } else { JsExpression functionRef = JsAstUtils.pureFqn(context.getNameForObjectInstance((ClassDescriptor) descriptor), null); return new JsInvocation(functionRef); } } + return context.getInnerReference(descriptor); } + @NotNull + public static JsExpression translateAsTypeReference(@NotNull ClassDescriptor descriptor, @NotNull TranslationContext context) { + if (AnnotationsUtils.isNativeObject(descriptor)) { + return context.getQualifiedReference(descriptor); + } + if (!shouldTranslateAsFQN(descriptor, context)) { + if (DescriptorUtils.isObject(descriptor) || DescriptorUtils.isEnumEntry(descriptor)) { + if (!context.isFromCurrentModule(descriptor)) { + return getLazyReferenceToObject(descriptor, context); + } + } + return context.getInnerReference(descriptor); + } + + JsExpression reference = context.getQualifiedReference(descriptor); + if (DescriptorUtils.isObject(descriptor) || DescriptorUtils.isEnumEntry(descriptor)) { + JsNameRef getPrototypeRef = JsAstUtils.pureFqn("getPrototypeOf", JsAstUtils.pureFqn("Object", null)); + JsInvocation getPrototypeInvocation = new JsInvocation(getPrototypeRef, reference); + MetadataProperties.setSideEffects(getPrototypeInvocation, SideEffectKind.PURE); + reference = JsAstUtils.pureFqn("constructor", getPrototypeInvocation); + } + + return reference; + } + + @NotNull + private static JsExpression getLazyReferenceToObject(@NotNull ClassDescriptor descriptor, @NotNull TranslationContext context) { + DeclarationDescriptor container = descriptor.getContainingDeclaration(); + JsExpression qualifier = context.getInnerReference(container); + return JsAstUtils.pureFqn(context.getNameForDescriptor(descriptor), qualifier); + } + + private static boolean shouldTranslateAsFQN(@NotNull DeclarationDescriptor descriptor, @NotNull TranslationContext context) { + return isLocalVarOrFunction(descriptor) || + AnnotationsUtils.isNativeObject(descriptor) || + AnnotationsUtils.isLibraryObject(descriptor) || + context.isPublicInlineFunction(); + } + + private static boolean isLocalVarOrFunction(DeclarationDescriptor descriptor) { + return descriptor.getContainingDeclaration() instanceof FunctionDescriptor && !(descriptor instanceof ClassDescriptor); + } + @NotNull public static AccessTranslator getAccessTranslator(@NotNull KtSimpleNameExpression referenceExpression, @NotNull TranslationContext context) { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/test/JSTestGenerator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/test/JSTestGenerator.java index 9d93d92ce81..b0483812a41 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/test/JSTestGenerator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/test/JSTestGenerator.java @@ -58,7 +58,7 @@ public final class JSTestGenerator { private static void generateCodeForTestMethod(@NotNull TranslationContext context, @NotNull FunctionDescriptor functionDescriptor, @NotNull ClassDescriptor classDescriptor, @NotNull JSTester tester) { - JsExpression expression = ReferenceTranslator.translateAsFQReference(classDescriptor, context); + JsExpression expression = ReferenceTranslator.translateAsValueReference(classDescriptor, context); JsNew testClass = new JsNew(expression); JsExpression functionToTestCall = CallTranslator.INSTANCE.buildCall(context, functionDescriptor, Collections.emptyList(), testClass); diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/inlineUtils.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/inlineUtils.kt index 07f423cd188..d6c477012f7 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/inlineUtils.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/inlineUtils.kt @@ -52,13 +52,13 @@ fun setInlineCallMetadata( "Expected descriptor of callable, that should be inlined, but got: $descriptor" } - val name = context.aliasedName(descriptor) + val candidateNames = setOf(context.aliasedName(descriptor), context.getInnerNameForDescriptor(descriptor)) val visitor = object : RecursiveJsVisitor() { override fun visitInvocation(invocation: JsInvocation) { super.visitInvocation(invocation) - if (name == invocation.name) { + if (invocation.name in candidateNames) { invocation.descriptor = descriptor invocation.inlineStrategy = InlineStrategy.IN_PLACE invocation.psiElement = psiElement diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt index 04aa876a077..8080c764303 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/utils/utils.kt @@ -21,6 +21,7 @@ import com.intellij.util.SmartList import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.js.translate.context.Namer import org.jetbrains.kotlin.js.translate.context.TranslationContext +import org.jetbrains.kotlin.js.translate.reference.ReferenceTranslator import org.jetbrains.kotlin.js.translate.utils.TranslationUtils.simpleReturnFunction import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.types.KotlinType @@ -78,27 +79,21 @@ fun List.splitToRanges(classifier: (T) -> S): List, S>> { return result } -fun getReferenceToJsClass(type: KotlinType, context: TranslationContext): JsNameRef { - val referenceToJsClass: JsNameRef - +fun getReferenceToJsClass(type: KotlinType, context: TranslationContext): JsExpression { val classifierDescriptor = type.constructor.declarationDescriptor - if (classifierDescriptor is ClassDescriptor) { - val reference = context.getInnerReference(classifierDescriptor) - if (classifierDescriptor.kind == ClassKind.OBJECT) { - referenceToJsClass = JsAstUtils.pureFqn("constructor", JsInvocation(JsNameRef("getPrototypeOf", JsNameRef("Object")), reference)) + val referenceToJsClass: JsExpression = when (classifierDescriptor) { + is ClassDescriptor -> { + ReferenceTranslator.translateAsTypeReference(classifierDescriptor, context) } - else { - referenceToJsClass = reference - } - } - else if (classifierDescriptor is TypeParameterDescriptor) { - assert(classifierDescriptor.isReified) + is TypeParameterDescriptor -> { + assert(classifierDescriptor.isReified) - referenceToJsClass = context.getNameForDescriptor(classifierDescriptor).makeRef() - } - else { - throw IllegalStateException("Can't get reference for $type") + context.getNameForDescriptor(classifierDescriptor).makeRef() + } + else -> { + throw IllegalStateException("Can't get reference for $type") + } } return referenceToJsClass diff --git a/js/js.translator/testData/box/closure/closureThisByUsingMethodFromParentClass.kt b/js/js.translator/testData/box/closure/closureThisByUsingMethodFromParentClass.kt index eaf2d77d884..4f741cde24a 100644 --- a/js/js.translator/testData/box/closure/closureThisByUsingMethodFromParentClass.kt +++ b/js/js.translator/testData/box/closure/closureThisByUsingMethodFromParentClass.kt @@ -5,13 +5,13 @@ package foo @native const val ROOT = "Kotlin.modules.JS_TESTS" @native -const val PATH_TO_F_CREATOR = "foo.B.far\$f" +const val PATH_TO_F_CREATOR = "B\$far\$lambda" @native -const val PATH_TO_G_CREATOR = "foo.B.gar\$f" +const val PATH_TO_G_CREATOR = "B\$gar\$lambda" -@native("$ROOT.$PATH_TO_F_CREATOR") +@native("$PATH_TO_F_CREATOR") val F_CREATOR: Any = noImpl -@native("$ROOT.$PATH_TO_G_CREATOR") +@native("$PATH_TO_G_CREATOR") val G_CREATOR: Any = noImpl @@ -38,7 +38,7 @@ fun box(): String { assertEquals("B::boo", g()) val fs = F_CREATOR.toString() - val gs = G_CREATOR.toString().replaceAll("boo", "foo") + val gs = G_CREATOR.toString().replaceAll("boo", "foo").replaceAll("gar", "far") assertEquals(gs, fs) diff --git a/js/js.translator/testData/box/inline/callableReference.kt b/js/js.translator/testData/box/inline/callableReference.kt index 7750273fd16..e491082861d 100644 --- a/js/js.translator/testData/box/inline/callableReference.kt +++ b/js/js.translator/testData/box/inline/callableReference.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: multiplyInline_0 -// CHECK_NOT_CALLED: runNoinline_0 +// CHECK_CONTAINS_NO_CALLS: multiplyInline +// CHECK_NOT_CALLED: runNoinline internal inline fun multiply(a: Int, b: Int) = a * b diff --git a/js/js.translator/testData/box/inline/expressionBodyWithLambdaCall.kt b/js/js.translator/testData/box/inline/expressionBodyWithLambdaCall.kt index 4142e60d25e..9bb30235fef 100644 --- a/js/js.translator/testData/box/inline/expressionBodyWithLambdaCall.kt +++ b/js/js.translator/testData/box/inline/expressionBodyWithLambdaCall.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test // A copy of stdlib run function. // Copied to not to depend on run implementation. diff --git a/js/js.translator/testData/box/inline/extensionWithManyArguments.kt b/js/js.translator/testData/box/inline/extensionWithManyArguments.kt index 06f456503fd..8d06face71b 100644 --- a/js/js.translator/testData/box/inline/extensionWithManyArguments.kt +++ b/js/js.translator/testData/box/inline/extensionWithManyArguments.kt @@ -1,6 +1,6 @@ package foo -// CHECK_NOT_CALLED_IN_SCOPE: scope=multiply_0 function=multiply_0$f +// CHECK_NOT_CALLED_IN_SCOPE: scope=multiply function=multiply$lambda internal class A(val a: Int) diff --git a/js/js.translator/testData/box/inline/inlineChain.kt b/js/js.translator/testData/box/inline/inlineChain.kt index 02ad206666a..03a0275c305 100644 --- a/js/js.translator/testData/box/inline/inlineChain.kt +++ b/js/js.translator/testData/box/inline/inlineChain.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo_0 +// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo internal inline fun inline1(a: Int): Int { return a diff --git a/js/js.translator/testData/box/inline/inlineChainWithFewStatements.kt b/js/js.translator/testData/box/inline/inlineChainWithFewStatements.kt index 8e5cd1b878d..01d4c501dde 100644 --- a/js/js.translator/testData/box/inline/inlineChainWithFewStatements.kt +++ b/js/js.translator/testData/box/inline/inlineChainWithFewStatements.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo_0 +// CHECK_CONTAINS_NO_CALLS: squareMultipliedByTwo internal inline fun inline1(a: Int): Int { return a diff --git a/js/js.translator/testData/box/inline/inlineDefaultArgument.kt b/js/js.translator/testData/box/inline/inlineDefaultArgument.kt index 2b65ea214ab..fdc596d6b3f 100644 --- a/js/js.translator/testData/box/inline/inlineDefaultArgument.kt +++ b/js/js.translator/testData/box/inline/inlineDefaultArgument.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: identity_0 -// CHECK_CONTAINS_NO_CALLS: sumNoInline_0 +// CHECK_CONTAINS_NO_CALLS: identity +// CHECK_CONTAINS_NO_CALLS: sumNoInline internal inline fun sum(a: Int, b: Int = 0): Int { return a + b diff --git a/js/js.translator/testData/box/inline/inlineFunctionInLambda.kt b/js/js.translator/testData/box/inline/inlineFunctionInLambda.kt index 0f245637565..00810f91643 100644 --- a/js/js.translator/testData/box/inline/inlineFunctionInLambda.kt +++ b/js/js.translator/testData/box/inline/inlineFunctionInLambda.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: doNothingNoInline_0 +// CHECK_CONTAINS_NO_CALLS: doNothingNoInline internal inline fun doNothing1(a: T): T { return a diff --git a/js/js.translator/testData/box/inline/inlineGenericSimple.kt b/js/js.translator/testData/box/inline/inlineGenericSimple.kt index 8229432adfc..8defd78ac2b 100644 --- a/js/js.translator/testData/box/inline/inlineGenericSimple.kt +++ b/js/js.translator/testData/box/inline/inlineGenericSimple.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: doNothingInt_0 -// CHECK_CONTAINS_NO_CALLS: doNothingStr_0 +// CHECK_CONTAINS_NO_CALLS: doNothingInt +// CHECK_CONTAINS_NO_CALLS: doNothingStr internal inline fun doNothing(a: T): T { return a diff --git a/js/js.translator/testData/box/inline/inlineInc.kt b/js/js.translator/testData/box/inline/inlineInc.kt index 32cf05e2393..f90c737cddf 100644 --- a/js/js.translator/testData/box/inline/inlineInc.kt +++ b/js/js.translator/testData/box/inline/inlineInc.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: multiplyNoInline_0 +// CHECK_CONTAINS_NO_CALLS: multiplyNoInline internal inline fun multiply(a: Int, b: Int): Int { return a * b diff --git a/js/js.translator/testData/box/inline/inlineIntSimple.kt b/js/js.translator/testData/box/inline/inlineIntSimple.kt index 3bad3b8f985..55411501952 100644 --- a/js/js.translator/testData/box/inline/inlineIntSimple.kt +++ b/js/js.translator/testData/box/inline/inlineIntSimple.kt @@ -1,8 +1,8 @@ package foo -// CHECK_CONTAINS_NO_CALLS: doNothing1_0 -// CHECK_CONTAINS_NO_CALLS: doNothing2_0 -// CHECK_CONTAINS_NO_CALLS: doNothing3_0 +// CHECK_CONTAINS_NO_CALLS: doNothing1 +// CHECK_CONTAINS_NO_CALLS: doNothing2 +// CHECK_CONTAINS_NO_CALLS: doNothing3 internal class Inline { public inline fun identity1 (x: T): T { diff --git a/js/js.translator/testData/box/inline/inlineLambdaNoCapture.kt b/js/js.translator/testData/box/inline/inlineLambdaNoCapture.kt index 91b733f45be..543522aedca 100644 --- a/js/js.translator/testData/box/inline/inlineLambdaNoCapture.kt +++ b/js/js.translator/testData/box/inline/inlineLambdaNoCapture.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: sumEven_0 +// CHECK_CONTAINS_NO_CALLS: sumEven internal inline fun filteredReduce(a: Array, predicate: (Int) -> Boolean, reduceFun: (Int, Int) -> Int): Int { var result = 0 diff --git a/js/js.translator/testData/box/inline/inlineLambdaWithCapture.kt b/js/js.translator/testData/box/inline/inlineLambdaWithCapture.kt index de80cf286da..2711c5b9728 100644 --- a/js/js.translator/testData/box/inline/inlineLambdaWithCapture.kt +++ b/js/js.translator/testData/box/inline/inlineLambdaWithCapture.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: maxBySquare_0 +// CHECK_CONTAINS_NO_CALLS: maxBySquare internal data class Result(var value: Int = 0, var invocationCount: Int = 0) diff --git a/js/js.translator/testData/box/inline/inlineMethod.kt b/js/js.translator/testData/box/inline/inlineMethod.kt index 17d7ac61406..b1bebc5dfb0 100644 --- a/js/js.translator/testData/box/inline/inlineMethod.kt +++ b/js/js.translator/testData/box/inline/inlineMethod.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: add_0 +// CHECK_CONTAINS_NO_CALLS: add internal data class IntPair(public var fst: Int, public var snd: Int) { inline public fun getFst(): Int { return fst } diff --git a/js/js.translator/testData/box/inline/inlineNoReturn.kt b/js/js.translator/testData/box/inline/inlineNoReturn.kt index a69a620a362..5fb1db05a38 100644 --- a/js/js.translator/testData/box/inline/inlineNoReturn.kt +++ b/js/js.translator/testData/box/inline/inlineNoReturn.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1_0 +// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1 internal class State(value: Int) { public var value: Int = value diff --git a/js/js.translator/testData/box/inline/jsCode.kt b/js/js.translator/testData/box/inline/jsCode.kt index 0e4c0ba5f44..5c2013cee92 100644 --- a/js/js.translator/testData/box/inline/jsCode.kt +++ b/js/js.translator/testData/box/inline/jsCode.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal inline fun sum(x: Int, y: Int): Int = js("x + y") diff --git a/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt b/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt index bbf988e7b14..474e0277071 100644 --- a/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt +++ b/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal inline fun sum(x: Int, y: Int): Int = js("var a = x; a + y") diff --git a/js/js.translator/testData/box/inline/lambdaInLambda.kt b/js/js.translator/testData/box/inline/lambdaInLambda.kt index b37394ebc84..065a3ac6ec0 100644 --- a/js/js.translator/testData/box/inline/lambdaInLambda.kt +++ b/js/js.translator/testData/box/inline/lambdaInLambda.kt @@ -1,8 +1,8 @@ package foo -// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f -// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f_0 -// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=run +// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda +// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda_0 +// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=run internal inline fun runLambdaInLambda(noinline inner: (T) -> T, outer: ((T) -> T, T) -> T, arg: T): T { return outer(inner, arg) diff --git a/js/js.translator/testData/box/inline/localInlineExtensionFunction.kt b/js/js.translator/testData/box/inline/localInlineExtensionFunction.kt index 77c6e3c5d27..1cb475e867b 100644 --- a/js/js.translator/testData/box/inline/localInlineExtensionFunction.kt +++ b/js/js.translator/testData/box/inline/localInlineExtensionFunction.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: capturedInLambda_0 -// CHECK_CONTAINS_NO_CALLS: declaredInLambda_0 +// CHECK_CONTAINS_NO_CALLS: capturedInLambda +// CHECK_CONTAINS_NO_CALLS: declaredInLambda internal data class State(var count: Int = 0) diff --git a/js/js.translator/testData/box/inline/localInlineFunction.kt b/js/js.translator/testData/box/inline/localInlineFunction.kt index 7ded0b56468..93b160369bd 100644 --- a/js/js.translator/testData/box/inline/localInlineFunction.kt +++ b/js/js.translator/testData/box/inline/localInlineFunction.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: localWithCapture_0 -// CHECK_CONTAINS_NO_CALLS: localWithoutCapture_0 +// CHECK_CONTAINS_NO_CALLS: localWithCapture +// CHECK_CONTAINS_NO_CALLS: localWithoutCapture internal inline fun repeatAction(times: Int, action: () -> Unit) { for (i in 1..times) { diff --git a/js/js.translator/testData/box/inline/localInlineFunctionComplex.kt b/js/js.translator/testData/box/inline/localInlineFunctionComplex.kt index 54c3075c8c0..9fc44e9a407 100644 --- a/js/js.translator/testData/box/inline/localInlineFunctionComplex.kt +++ b/js/js.translator/testData/box/inline/localInlineFunctionComplex.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: add_0 +// CHECK_CONTAINS_NO_CALLS: add internal data class State(var count: Int = 0) diff --git a/js/js.translator/testData/box/inline/localInlineFunctionDeclaredInLambda.kt b/js/js.translator/testData/box/inline/localInlineFunctionDeclaredInLambda.kt index 6b3e2dc6c6b..4accbf37829 100644 --- a/js/js.translator/testData/box/inline/localInlineFunctionDeclaredInLambda.kt +++ b/js/js.translator/testData/box/inline/localInlineFunctionDeclaredInLambda.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: localWithCapture_0 -// CHECK_CONTAINS_NO_CALLS: localWithoutCapture_0 +// CHECK_CONTAINS_NO_CALLS: localWithCapture +// CHECK_CONTAINS_NO_CALLS: localWithoutCapture internal inline fun repeatAction(times: Int, action: () -> Unit) { for (i in 1..times) { diff --git a/js/js.translator/testData/box/inline/localInlineFunctionNameClash.kt b/js/js.translator/testData/box/inline/localInlineFunctionNameClash.kt index a25f38a7030..a6755eb1c23 100644 --- a/js/js.translator/testData/box/inline/localInlineFunctionNameClash.kt +++ b/js/js.translator/testData/box/inline/localInlineFunctionNameClash.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: add_0 +// CHECK_CONTAINS_NO_CALLS: add internal inline fun run(action: () -> Int): Int { return action() diff --git a/js/js.translator/testData/box/inline/metadataForPublicFunction.kt b/js/js.translator/testData/box/inline/metadataForPublicFunction.kt index 7dedf267f1e..c0ea216f92d 100644 --- a/js/js.translator/testData/box/inline/metadataForPublicFunction.kt +++ b/js/js.translator/testData/box/inline/metadataForPublicFunction.kt @@ -1,11 +1,11 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test1_0 -// CHECK_CONTAINS_NO_CALLS: test2_0 -// CHECK_CONTAINS_NO_CALLS: test3_0 +// CHECK_CONTAINS_NO_CALLS: test1 +// CHECK_CONTAINS_NO_CALLS: test2 +// CHECK_CONTAINS_NO_CALLS: test3 // CHECK_CONTAINS_NO_CALLS: test4_buocd8$ -// CHECK_CONTAINS_NO_CALLS: test5_0 -// CHECK_HAS_INLINE_METADATA: apply_hiyix$ +// CHECK_CONTAINS_NO_CALLS: test5 +// CHECK_HAS_INLINE_METADATA: apply // CHECK_HAS_INLINE_METADATA: applyL_hiyix$ // CHECK_HAS_INLINE_METADATA: applyM_hiyix$ // CHECK_HAS_NO_INLINE_METADATA: applyN_hiyix$ diff --git a/js/js.translator/testData/box/inline/noInlineLambda.kt b/js/js.translator/testData/box/inline/noInlineLambda.kt index 6e4c18767b6..e4ff8ae7396 100644 --- a/js/js.translator/testData/box/inline/noInlineLambda.kt +++ b/js/js.translator/testData/box/inline/noInlineLambda.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=multiplyBy2_0$f -// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2_0 function=run +// CHECK_CALLED_IN_SCOPE: scope=multiplyBy2 function=multiplyBy2$lambda +// CHECK_NOT_CALLED_IN_SCOPE: scope=multiplyBy2 function=run internal inline fun run(noinline func: (T) -> T, arg: T): T { return func(arg) diff --git a/js/js.translator/testData/box/inline/safeCall.kt b/js/js.translator/testData/box/inline/safeCall.kt index 2870b1a9f52..f19c95eb929 100644 --- a/js/js.translator/testData/box/inline/safeCall.kt +++ b/js/js.translator/testData/box/inline/safeCall.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: sum_0 +// CHECK_CONTAINS_NO_CALLS: sum inline fun T.doLet(f: (T) -> R): R = f(this) diff --git a/js/js.translator/testData/box/inline/vararg.kt b/js/js.translator/testData/box/inline/vararg.kt index 919635210e0..66bd5652acc 100644 --- a/js/js.translator/testData/box/inline/vararg.kt +++ b/js/js.translator/testData/box/inline/vararg.kt @@ -1,9 +1,9 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test1_0 -// CHECK_CONTAINS_NO_CALLS: test2_0 -// CHECK_CONTAINS_NO_CALLS: test3_0 except=slice +// CHECK_CONTAINS_NO_CALLS: test1 +// CHECK_CONTAINS_NO_CALLS: test2 +// CHECK_CONTAINS_NO_CALLS: test3 except=slice internal inline fun concat(vararg strings: String): String { var result = "" diff --git a/js/js.translator/testData/box/inlineMultiFile/trait.kt b/js/js.translator/testData/box/inlineMultiFile/trait.kt index 3828e71e56b..836ccf4d648 100644 --- a/js/js.translator/testData/box/inlineMultiFile/trait.kt +++ b/js/js.translator/testData/box/inlineMultiFile/trait.kt @@ -8,7 +8,7 @@ package foo import test.* -// CHECK_CONTAINS_NO_CALLS: testClassObject_0 +// CHECK_CONTAINS_NO_CALLS: testClassObject internal fun testFinalInline(): String { return Z().finalInline({"final"}) diff --git a/js/js.translator/testData/box/inlineMultiModule/anotherModuleValInClosure.kt b/js/js.translator/testData/box/inlineMultiModule/anotherModuleValInClosure.kt index 4cfa5e0fb09..4fc0ae3da3d 100644 --- a/js/js.translator/testData/box/inlineMultiModule/anotherModuleValInClosure.kt +++ b/js/js.translator/testData/box/inlineMultiModule/anotherModuleValInClosure.kt @@ -17,7 +17,7 @@ public fun log(s: String): String { import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(s: String): String = log(s + ";") diff --git a/js/js.translator/testData/box/inlineMultiModule/callableReference.kt b/js/js.translator/testData/box/inlineMultiModule/callableReference.kt index daa25a75a47..6711b832bd4 100644 --- a/js/js.translator/testData/box/inlineMultiModule/callableReference.kt +++ b/js/js.translator/testData/box/inlineMultiModule/callableReference.kt @@ -12,7 +12,7 @@ public fun apply(x: T, fn: (T)->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun multiplyBy2(x: Int): Int = x * 2 diff --git a/js/js.translator/testData/box/inlineMultiModule/calledByFqName.kt b/js/js.translator/testData/box/inlineMultiModule/calledByFqName.kt index 8e2d3613866..fff86e5d1d1 100644 --- a/js/js.translator/testData/box/inlineMultiModule/calledByFqName.kt +++ b/js/js.translator/testData/box/inlineMultiModule/calledByFqName.kt @@ -9,7 +9,7 @@ public fun sum(x: Int, y: Int): Int = // MODULE: main(lib) // FILE: main.kt -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int, y: Int): Int = utils.sum(x, y) diff --git a/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt b/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt index de488cd5344..9784f87ab94 100644 --- a/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt +++ b/js/js.translator/testData/box/inlineMultiModule/extensionLambda.kt @@ -13,7 +13,7 @@ public fun apply(x: T, fn: T.()->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal class A(val n: Int) diff --git a/js/js.translator/testData/box/inlineMultiModule/lambda.kt b/js/js.translator/testData/box/inlineMultiModule/lambda.kt index 20095ee1f08..3891bd75af8 100644 --- a/js/js.translator/testData/box/inlineMultiModule/lambda.kt +++ b/js/js.translator/testData/box/inlineMultiModule/lambda.kt @@ -13,7 +13,7 @@ public fun apply(x: T, fn: (T)->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int): Int = apply(x) { it * 2 } diff --git a/js/js.translator/testData/box/inlineMultiModule/lambdaWithClosure.kt b/js/js.translator/testData/box/inlineMultiModule/lambdaWithClosure.kt index ee93ba322ed..c95dafc1119 100644 --- a/js/js.translator/testData/box/inlineMultiModule/lambdaWithClosure.kt +++ b/js/js.translator/testData/box/inlineMultiModule/lambdaWithClosure.kt @@ -13,7 +13,7 @@ public fun apply(x: T, fn: (T)->R): R = import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int, y: Int): Int = apply(x) { it + y } diff --git a/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt b/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt index 7792b410e57..024c8985275 100644 --- a/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt +++ b/js/js.translator/testData/box/inlineMultiModule/localNameClash.kt @@ -15,7 +15,7 @@ public fun apply(x: T, fn: (T)->R): R { import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int, y: Int): Int = apply(x) { it + 1 } * y diff --git a/js/js.translator/testData/box/inlineMultiModule/method.kt b/js/js.translator/testData/box/inlineMultiModule/method.kt index 213cf992788..b154ad2f222 100644 --- a/js/js.translator/testData/box/inlineMultiModule/method.kt +++ b/js/js.translator/testData/box/inlineMultiModule/method.kt @@ -14,7 +14,7 @@ public class A(public val x: Int) { import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(a: A, y: Int): Int = a.plus(y) diff --git a/js/js.translator/testData/box/inlineMultiModule/simple.kt b/js/js.translator/testData/box/inlineMultiModule/simple.kt index fb1140f5b65..69154c95589 100644 --- a/js/js.translator/testData/box/inlineMultiModule/simple.kt +++ b/js/js.translator/testData/box/inlineMultiModule/simple.kt @@ -13,7 +13,7 @@ public fun sum(x: Int, y: Int): Int = import utils.* -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int, y: Int): Int = sum(x, y) diff --git a/js/js.translator/testData/box/inlineSizeReduction/lastBreak.kt b/js/js.translator/testData/box/inlineSizeReduction/lastBreak.kt index ecc587e666c..c9ee16efce9 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/lastBreak.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/lastBreak.kt @@ -1,8 +1,8 @@ package foo -// CHECK_NOT_CALLED: f1_0 -// CHECK_NOT_CALLED: f2_0 -// CHECK_BREAKS_COUNT: function=test_0 count=3 +// CHECK_NOT_CALLED: f1 +// CHECK_NOT_CALLED: f2 +// CHECK_BREAKS_COUNT: function=test count=3 internal var even = arrayListOf() internal var odd = arrayListOf() diff --git a/js/js.translator/testData/box/inlineSizeReduction/noDuplicateVariableDeclaration.kt b/js/js.translator/testData/box/inlineSizeReduction/noDuplicateVariableDeclaration.kt index 2a12bda0ba0..b5b44d9e045 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/noDuplicateVariableDeclaration.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/noDuplicateVariableDeclaration.kt @@ -1,6 +1,6 @@ package foo -// CHECK_VARS_COUNT: function=test_za3lpa$ count=2 +// CHECK_VARS_COUNT: function=test count=2 inline fun if1(f: (Int) -> Int, a: Int, b: Int, c: Int): Int { val result = f(a) diff --git a/js/js.translator/testData/box/inlineSizeReduction/oneTopLevelReturn.kt b/js/js.translator/testData/box/inlineSizeReduction/oneTopLevelReturn.kt index b33ef4358ee..8ba8182f4ef 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/oneTopLevelReturn.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/oneTopLevelReturn.kt @@ -1,9 +1,9 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test1_0 -// CHECK_CONTAINS_NO_CALLS: test2_0 -// CHECK_VARS_COUNT: function=test1_0 count=0 -// CHECK_VARS_COUNT: function=test2_0 count=1 +// CHECK_CONTAINS_NO_CALLS: test1 +// CHECK_CONTAINS_NO_CALLS: test2 +// CHECK_VARS_COUNT: function=test1 count=0 +// CHECK_VARS_COUNT: function=test2 count=1 var log = "" diff --git a/js/js.translator/testData/box/inlineSizeReduction/propertyAssignment.kt b/js/js.translator/testData/box/inlineSizeReduction/propertyAssignment.kt index 8ad70c8c9a4..23edffe9ad9 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/propertyAssignment.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/propertyAssignment.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=0 +// CHECK_CONTAINS_NO_CALLS: test except=SumHolder_getInstance +// CHECK_VARS_COUNT: function=test count=1 object SumHolder { var sum = 0 diff --git a/js/js.translator/testData/box/inlineSizeReduction/returnInlineCall.kt b/js/js.translator/testData/box/inlineSizeReduction/returnInlineCall.kt index bf66ae7e674..11bef5562d8 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/returnInlineCall.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/returnInlineCall.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=0 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_VARS_COUNT: function=test count=0 internal inline fun sign(x: Int): Int { if (x < 0) return -1 diff --git a/js/js.translator/testData/box/inlineSizeReduction/simpleReturnFunction.kt b/js/js.translator/testData/box/inlineSizeReduction/simpleReturnFunction.kt index 71114a2f702..ce7adf0078d 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/simpleReturnFunction.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/simpleReturnFunction.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=0 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_VARS_COUNT: function=test count=0 // A copy of stdlib run function. // Copied to not to depend on run implementation. diff --git a/js/js.translator/testData/box/inlineSizeReduction/ternaryConditional.kt b/js/js.translator/testData/box/inlineSizeReduction/ternaryConditional.kt index 0294f8f4eca..b71963ee7c8 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/ternaryConditional.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/ternaryConditional.kt @@ -1,8 +1,8 @@ package foo -// CHECK_VARS_COUNT: function=test1_za3lpa$ count=0 -// CHECK_VARS_COUNT: function=test2_za3lpa$ count=1 -// CHECK_VARS_COUNT: function=test3_za3lpa$ count=0 +// CHECK_VARS_COUNT: function=test1 count=0 +// CHECK_VARS_COUNT: function=test2 count=1 +// CHECK_VARS_COUNT: function=test3 count=0 inline fun a(x: Int) = b(x) diff --git a/js/js.translator/testData/box/inlineSizeReduction/this.kt b/js/js.translator/testData/box/inlineSizeReduction/this.kt index 5fafd6800a0..4c222fffbe1 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/this.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/this.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=0 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_VARS_COUNT: function=test count=0 internal class A(val x: Int) { inline fun f(): Int = x diff --git a/js/js.translator/testData/box/inlineSizeReduction/valAssignment.kt b/js/js.translator/testData/box/inlineSizeReduction/valAssignment.kt index d66e656ad20..fa465f6a2ac 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/valAssignment.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/valAssignment.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=1 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_VARS_COUNT: function=test count=1 internal inline fun sum(x: Int, y: Int): Int { if (x == 0 || y == 0) return 0 diff --git a/js/js.translator/testData/box/inlineSizeReduction/valDeclaration.kt b/js/js.translator/testData/box/inlineSizeReduction/valDeclaration.kt index 1384fa95389..dc781650c52 100644 --- a/js/js.translator/testData/box/inlineSizeReduction/valDeclaration.kt +++ b/js/js.translator/testData/box/inlineSizeReduction/valDeclaration.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_VARS_COUNT: function=test_0 count=1 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_VARS_COUNT: function=test count=1 internal inline fun sum(x: Int, y: Int): Int { if (x == 0 || y == 0) return 0 diff --git a/js/js.translator/testData/box/inlineStdlib/callableRefToFunInCurrentModule.kt b/js/js.translator/testData/box/inlineStdlib/callableRefToFunInCurrentModule.kt index dabfca3154e..818e656b180 100644 --- a/js/js.translator/testData/box/inlineStdlib/callableRefToFunInCurrentModule.kt +++ b/js/js.translator/testData/box/inlineStdlib/callableRefToFunInCurrentModule.kt @@ -1,7 +1,7 @@ package foo -// CHECK_NOT_CALLED_IN_SCOPE: scope=test_0 function=even_0 -// CHECK_NOT_CALLED_IN_SCOPE: scope=test_0 function=filter_azvtw4$ +// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=even +// CHECK_NOT_CALLED_IN_SCOPE: scope=test function=filter_azvtw4$ internal fun even(x: Int) = x % 2 == 0 diff --git a/js/js.translator/testData/box/inlineStdlib/closure.kt b/js/js.translator/testData/box/inlineStdlib/closure.kt index b44d70c3f2c..7c0cdcffcc1 100644 --- a/js/js.translator/testData/box/inlineStdlib/closure.kt +++ b/js/js.translator/testData/box/inlineStdlib/closure.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(a: Int, b: Int): Int { var c = 0 diff --git a/js/js.translator/testData/box/inlineStdlib/closureNested.kt b/js/js.translator/testData/box/inlineStdlib/closureNested.kt index c778774375d..293e39568f1 100644 --- a/js/js.translator/testData/box/inlineStdlib/closureNested.kt +++ b/js/js.translator/testData/box/inlineStdlib/closureNested.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(a: Int, b: Int): Int { var res = 0 diff --git a/js/js.translator/testData/box/inlineStdlib/localNamesClash.kt b/js/js.translator/testData/box/inlineStdlib/localNamesClash.kt index bbfd9e91fd5..81152cb0e8a 100644 --- a/js/js.translator/testData/box/inlineStdlib/localNamesClash.kt +++ b/js/js.translator/testData/box/inlineStdlib/localNamesClash.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal fun test(x: Int, y: Int): Int = with (x + x) { diff --git a/js/js.translator/testData/box/inlineStdlib/simple.kt b/js/js.translator/testData/box/inlineStdlib/simple.kt index 16e1ae9b8d5..f45144b8fc5 100644 --- a/js/js.translator/testData/box/inlineStdlib/simple.kt +++ b/js/js.translator/testData/box/inlineStdlib/simple.kt @@ -1,6 +1,6 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 +// CHECK_CONTAINS_NO_CALLS: test internal var counter = 0 diff --git a/js/js.translator/testData/box/inlineStdlib/thisInExtension.kt b/js/js.translator/testData/box/inlineStdlib/thisInExtension.kt index 2fca828c793..08737565749 100644 --- a/js/js.translator/testData/box/inlineStdlib/thisInExtension.kt +++ b/js/js.translator/testData/box/inlineStdlib/thisInExtension.kt @@ -1,7 +1,7 @@ package foo -// CHECK_CONTAINS_NO_CALLS: testImplicitThis_0 -// CHECK_CONTAINS_NO_CALLS: testExplicitThis_0 +// CHECK_CONTAINS_NO_CALLS: testImplicitThis +// CHECK_CONTAINS_NO_CALLS: testExplicitThis internal class A(var value: Int) diff --git a/js/js.translator/testData/box/labels/nestedLabelsInlinedClashing.kt b/js/js.translator/testData/box/labels/nestedLabelsInlinedClashing.kt index 3244789046c..1e244a1d32e 100644 --- a/js/js.translator/testData/box/labels/nestedLabelsInlinedClashing.kt +++ b/js/js.translator/testData/box/labels/nestedLabelsInlinedClashing.kt @@ -1,9 +1,9 @@ package foo -// CHECK_CONTAINS_NO_CALLS: test_0 -// CHECK_LABELS_COUNT: function=test_0 name=loop count=1 -// CHECK_LABELS_COUNT: function=test_0 name=loop_0 count=1 -// CHECK_LABELS_COUNT: function=test_0 name=loop_1 count=1 +// CHECK_CONTAINS_NO_CALLS: test +// CHECK_LABELS_COUNT: function=test name=loop count=1 +// CHECK_LABELS_COUNT: function=test name=loop_0 count=1 +// CHECK_LABELS_COUNT: function=test name=loop_1 count=1 class State() { public var value: Int = 0 diff --git a/js/js.translator/testData/box/labels/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt b/js/js.translator/testData/box/labels/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt index cd2fea8d12e..c5a53354956 100644 --- a/js/js.translator/testData/box/labels/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt +++ b/js/js.translator/testData/box/labels/nestedLabelsInlinedClashingAtFunctionsWithClosure.kt @@ -1,8 +1,8 @@ package foo -// CHECK_LABELS_COUNT: function=test_0 name=loop count=1 -// CHECK_LABELS_COUNT: function=test_0 name=loop_0 count=1 -// CHECK_LABELS_COUNT: function=test_0 name=loop_1 count=1 +// CHECK_LABELS_COUNT: function=test name=loop count=1 +// CHECK_LABELS_COUNT: function=test name=loop_0 count=1 +// CHECK_LABELS_COUNT: function=test name=loop_1 count=1 class State() { public var value: Int = 0 diff --git a/js/js.translator/testData/box/reservedWords/CASES.txt b/js/js.translator/testData/box/reservedWords/CASES.txt deleted file mode 100644 index bcc4dcc8a01..00000000000 --- a/js/js.translator/testData/box/reservedWords/CASES.txt +++ /dev/null @@ -1,45 +0,0 @@ -NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! -dataClass / param -dataClass / val -dataClass / var -delegated / fun -delegated / funParam -delegated / label -delegated / val -delegated / var -enum / entry -enum / fun -enum / funParam -enum / label -enum / val -enum / var -insideClass / fun -insideClass / funParam -insideClass / label -insideClass / val -insideClass / var -insideClassObject / fun -insideClassObject / funParam -insideClassObject / label -insideClassObject / val -insideClassObject / var -insideObject / fun -insideObject / funParam -insideObject / label -insideObject / val -insideObject / var -local / catch -local / fun -local / funParam -local / label -local / val -local / var -toplevel / class -toplevel / enum -toplevel / fun -toplevel / funParam -toplevel / interface -toplevel / label -toplevel / object -toplevel / val -toplevel / var \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/SHOULD_BE_ESCAPED.txt b/js/js.translator/testData/box/reservedWords/SHOULD_BE_ESCAPED.txt deleted file mode 100644 index a207b8d1bb9..00000000000 --- a/js/js.translator/testData/box/reservedWords/SHOULD_BE_ESCAPED.txt +++ /dev/null @@ -1,22 +0,0 @@ -NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! -break -class -continue -do -else -false -for -if -in -interface -null -package -return -super -this -throw -true -try -typeof -var -while \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/SHOULD_NOT_BE_ESCAPED.txt b/js/js.translator/testData/box/reservedWords/SHOULD_NOT_BE_ESCAPED.txt deleted file mode 100644 index e7954fabd27..00000000000 --- a/js/js.translator/testData/box/reservedWords/SHOULD_NOT_BE_ESCAPED.txt +++ /dev/null @@ -1,32 +0,0 @@ -NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! -Infinity -Kotlin -NaN -arguments -await -case -catch -const -debugger -default -delete -enum -eval -export -extends -finally -function -implements -import -instanceof -let -new -private -protected -public -static -switch -undefined -void -with -yield \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/_common.kt b/js/js.translator/testData/box/reservedWords/_common.kt deleted file mode 100644 index debca3838d2..00000000000 --- a/js/js.translator/testData/box/reservedWords/_common.kt +++ /dev/null @@ -1,24 +0,0 @@ -package foo - -import kotlin.text.Regex - -fun testRenamed(case: String, f: () -> Unit) = test(case, true, f) -fun testNotRenamed(case: String, f: () -> Unit) = test(case, false, f) - -fun test(keyword: String, expectedRenamed: Boolean, f: Any) { - val fs = f.toString().replace("while (false)", "") - val matches = Regex("[\\w$]*$keyword[\\w_$]*").matchAll(fs).map { it.value }.toList() - - assertNotEquals(0, matches.size, "matches is empty for fs = $fs") - - val actual = matches.last() - - assertTrue(actual.contains(keyword), "'$keyword' not found in '$matches' from '$fs'") - - if (expectedRenamed) { - assertNotEquals(keyword, actual, "fs = $fs") - } - else { - assertEquals(keyword, actual, "fs = $fs") - } -} diff --git a/js/js.translator/testData/box/reservedWords/dataClassValTypeof.kt b/js/js.translator/testData/box/reservedWords/dataClassValTypeof.kt deleted file mode 100644 index e0fc9c40245..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassValTypeof.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(val `typeof`: String) { - init { - testNotRenamed("typeof", { `typeof` }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassValVar.kt b/js/js.translator/testData/box/reservedWords/dataClassValVar.kt deleted file mode 100644 index f402b94320a..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassValVar.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(val `var`: String) { - init { - testNotRenamed("var", { `var` }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassValWith.kt b/js/js.translator/testData/box/reservedWords/dataClassValWith.kt deleted file mode 100644 index 7f642e2eae6..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassValWith.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(val with: String) { - init { - testNotRenamed("with", { with }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassValYield.kt b/js/js.translator/testData/box/reservedWords/dataClassValYield.kt deleted file mode 100644 index ba692348f88..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassValYield.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(val yield: String) { - init { - testNotRenamed("yield", { yield }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassVarBreak.kt b/js/js.translator/testData/box/reservedWords/dataClassVarBreak.kt deleted file mode 100644 index 422b6616b15..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassVarBreak.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(var `break`: String) { - init { - testNotRenamed("break", { `break` }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassVarInfinity.kt b/js/js.translator/testData/box/reservedWords/dataClassVarInfinity.kt deleted file mode 100644 index 23da1e006fc..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassVarInfinity.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(var Infinity: String) { - init { - testNotRenamed("Infinity", { Infinity }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassVarKotlin.kt b/js/js.translator/testData/box/reservedWords/dataClassVarKotlin.kt deleted file mode 100644 index a73fff589ff..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassVarKotlin.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(var Kotlin: String) { - init { - testNotRenamed("Kotlin", { Kotlin }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/dataClassVarWhile.kt b/js/js.translator/testData/box/reservedWords/dataClassVarWhile.kt deleted file mode 100644 index 776e4acc7aa..00000000000 --- a/js/js.translator/testData/box/reservedWords/dataClassVarWhile.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -data class DataClass(var `while`: String) { - init { - testNotRenamed("while", { `while` }) - } -} - -fun box(): String { - DataClass("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunDebugger.kt b/js/js.translator/testData/box/reservedWords/delegatedFunDebugger.kt deleted file mode 100644 index b484bd5cd60..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunDebugger.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun debugger() -} - -class TraitImpl : Trait { - override fun debugger() { debugger() } -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("debugger", { debugger() }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunDefault.kt b/js/js.translator/testData/box/reservedWords/delegatedFunDefault.kt deleted file mode 100644 index a4567d90145..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunDefault.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun default() -} - -class TraitImpl : Trait { - override fun default() { default() } -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("default", { default() }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunIf.kt b/js/js.translator/testData/box/reservedWords/delegatedFunIf.kt deleted file mode 100644 index f1bf64b0019..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunIf.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun `if`() -} - -class TraitImpl : Trait { - override fun `if`() { `if`() } -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("if", { `if`() }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunIn.kt b/js/js.translator/testData/box/reservedWords/delegatedFunIn.kt deleted file mode 100644 index fc7e8ee36aa..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunIn.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun `in`() -} - -class TraitImpl : Trait { - override fun `in`() { `in`() } -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("in", { `in`() }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunParamDelete.kt b/js/js.translator/testData/box/reservedWords/delegatedFunParamDelete.kt deleted file mode 100644 index c820a1b2763..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunParamDelete.kt +++ /dev/null @@ -1,26 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun foo(delete: String) -} - -class TraitImpl : Trait { - override fun foo(delete: String) { - assertEquals("123", delete) - testRenamed("delete", { delete }) -} -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - foo("123") - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunParamEnum.kt b/js/js.translator/testData/box/reservedWords/delegatedFunParamEnum.kt deleted file mode 100644 index 0e168a885b2..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunParamEnum.kt +++ /dev/null @@ -1,26 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun foo(enum: String) -} - -class TraitImpl : Trait { - override fun foo(enum: String) { - assertEquals("123", enum) - testRenamed("enum", { enum }) -} -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - foo("123") - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunParamInterface.kt b/js/js.translator/testData/box/reservedWords/delegatedFunParamInterface.kt deleted file mode 100644 index 3f3c69693d4..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunParamInterface.kt +++ /dev/null @@ -1,26 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun foo(`interface`: String) -} - -class TraitImpl : Trait { - override fun foo(`interface`: String) { - assertEquals("123", `interface`) - testRenamed("interface", { `interface` }) -} -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - foo("123") - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedFunParamNull.kt b/js/js.translator/testData/box/reservedWords/delegatedFunParamNull.kt deleted file mode 100644 index 033cf91f32c..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedFunParamNull.kt +++ /dev/null @@ -1,26 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - fun foo(`null`: String) -} - -class TraitImpl : Trait { - override fun foo(`null`: String) { - assertEquals("123", `null`) - testRenamed("null", { `null` }) -} -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - foo("123") - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedLabelEval.kt b/js/js.translator/testData/box/reservedWords/delegatedLabelEval.kt deleted file mode 100644 index 92fec6c006b..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedLabelEval.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val t: Int -} - -class TraitImpl : Trait { - override val t: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testRenamed("eval", { eval@ while (false) {} }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedLabelExport.kt b/js/js.translator/testData/box/reservedWords/delegatedLabelExport.kt deleted file mode 100644 index 4da2d38642d..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedLabelExport.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val t: Int -} - -class TraitImpl : Trait { - override val t: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testRenamed("export", { export@ while (false) {} }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedLabelPackage.kt b/js/js.translator/testData/box/reservedWords/delegatedLabelPackage.kt deleted file mode 100644 index cf17d2da6c1..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedLabelPackage.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val t: Int -} - -class TraitImpl : Trait { - override val t: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testRenamed("package", { `package`@ while (false) {} }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedLabelReturn.kt b/js/js.translator/testData/box/reservedWords/delegatedLabelReturn.kt deleted file mode 100644 index 69c3b606683..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedLabelReturn.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val t: Int -} - -class TraitImpl : Trait { - override val t: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testRenamed("return", { `return`@ while (false) {} }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedValAwait.kt b/js/js.translator/testData/box/reservedWords/delegatedValAwait.kt deleted file mode 100644 index 1cd04171411..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedValAwait.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val await: Int -} - -class TraitImpl : Trait { - override val await: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("await", { await }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedValCase.kt b/js/js.translator/testData/box/reservedWords/delegatedValCase.kt deleted file mode 100644 index e75477dd42b..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedValCase.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val case: Int -} - -class TraitImpl : Trait { - override val case: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("case", { case }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedValDo.kt b/js/js.translator/testData/box/reservedWords/delegatedValDo.kt deleted file mode 100644 index 077ba008983..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedValDo.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val `do`: Int -} - -class TraitImpl : Trait { - override val `do`: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("do", { `do` }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedValElse.kt b/js/js.translator/testData/box/reservedWords/delegatedValElse.kt deleted file mode 100644 index a7dc69ad23a..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedValElse.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - val `else`: Int -} - -class TraitImpl : Trait { - override val `else`: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("else", { `else` }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedVarCatch.kt b/js/js.translator/testData/box/reservedWords/delegatedVarCatch.kt deleted file mode 100644 index 1bb4e6c1020..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedVarCatch.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - var catch: Int -} - -class TraitImpl : Trait { - override var catch: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("catch", { catch }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedVarConst.kt b/js/js.translator/testData/box/reservedWords/delegatedVarConst.kt deleted file mode 100644 index 469b16b71d2..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedVarConst.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - var const: Int -} - -class TraitImpl : Trait { - override var const: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("const", { const }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedVarFalse.kt b/js/js.translator/testData/box/reservedWords/delegatedVarFalse.kt deleted file mode 100644 index dbfbba316bd..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedVarFalse.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - var `false`: Int -} - -class TraitImpl : Trait { - override var `false`: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("false", { `false` }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/delegatedVarFor.kt b/js/js.translator/testData/box/reservedWords/delegatedVarFor.kt deleted file mode 100644 index d30746aa852..00000000000 --- a/js/js.translator/testData/box/reservedWords/delegatedVarFor.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface Trait { - var `for`: Int -} - -class TraitImpl : Trait { - override var `for`: Int = 0 -} - -class TestDelegate : Trait by TraitImpl() { - fun test() { - testNotRenamed("for", { `for` }) - } -} - -fun box(): String { - TestDelegate().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumEntryContinue.kt b/js/js.translator/testData/box/reservedWords/enumEntryContinue.kt deleted file mode 100644 index a6881b51875..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumEntryContinue.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - `continue` -} - -fun box(): String { - testNotRenamed("continue", { Foo.`continue` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumEntryDo.kt b/js/js.translator/testData/box/reservedWords/enumEntryDo.kt deleted file mode 100644 index a593141c31b..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumEntryDo.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - `do` -} - -fun box(): String { - testNotRenamed("do", { Foo.`do` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumEntryPublic.kt b/js/js.translator/testData/box/reservedWords/enumEntryPublic.kt deleted file mode 100644 index 951d6ae0b2f..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumEntryPublic.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - `public` -} - -fun box(): String { - testNotRenamed("public", { Foo.`public` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumEntryStatic.kt b/js/js.translator/testData/box/reservedWords/enumEntryStatic.kt deleted file mode 100644 index 6c4453b83b2..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumEntryStatic.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - static -} - -fun box(): String { - testNotRenamed("static", { Foo.static }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunImport.kt b/js/js.translator/testData/box/reservedWords/enumFunImport.kt deleted file mode 100644 index ceebb4a8c31..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunImport.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun import() { import() } - - fun test() { - testNotRenamed("import", { import() }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunInstanceof.kt b/js/js.translator/testData/box/reservedWords/enumFunInstanceof.kt deleted file mode 100644 index 309a1f7ae6c..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunInstanceof.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun instanceof() { instanceof() } - - fun test() { - testNotRenamed("instanceof", { instanceof() }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunParamLet.kt b/js/js.translator/testData/box/reservedWords/enumFunParamLet.kt deleted file mode 100644 index 7c1351c1f65..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunParamLet.kt +++ /dev/null @@ -1,21 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun foo(let: String) { - assertEquals("123", let) - testRenamed("let", { let }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunParamNew.kt b/js/js.translator/testData/box/reservedWords/enumFunParamNew.kt deleted file mode 100644 index 8a011e62d69..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunParamNew.kt +++ /dev/null @@ -1,21 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun foo(new: String) { - assertEquals("123", new) - testRenamed("new", { new }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunParamVar.kt b/js/js.translator/testData/box/reservedWords/enumFunParamVar.kt deleted file mode 100644 index 1aed84b4c86..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunParamVar.kt +++ /dev/null @@ -1,21 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun foo(`var`: String) { - assertEquals("123", `var`) - testRenamed("var", { `var` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunParamWhile.kt b/js/js.translator/testData/box/reservedWords/enumFunParamWhile.kt deleted file mode 100644 index f4abf35a877..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunParamWhile.kt +++ /dev/null @@ -1,21 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun foo(`while`: String) { - assertEquals("123", `while`) - testRenamed("while", { `while` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunTry.kt b/js/js.translator/testData/box/reservedWords/enumFunTry.kt deleted file mode 100644 index 1e7f201a027..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunTry.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun `try`() { `try`() } - - fun test() { - testNotRenamed("try", { `try`() }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumFunTypeof.kt b/js/js.translator/testData/box/reservedWords/enumFunTypeof.kt deleted file mode 100644 index 62c35e1c7f6..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumFunTypeof.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - fun `typeof`() { `typeof`() } - - fun test() { - testNotRenamed("typeof", { `typeof`() }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumLabelBreak.kt b/js/js.translator/testData/box/reservedWords/enumLabelBreak.kt deleted file mode 100644 index e1aec6d8345..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumLabelBreak.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val t: Int = 0 - - fun test() { - testRenamed("break", { `break`@ while (false) {} }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumLabelClass.kt b/js/js.translator/testData/box/reservedWords/enumLabelClass.kt deleted file mode 100644 index a1dfc6559ad..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumLabelClass.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val t: Int = 0 - - fun test() { - testRenamed("class", { `class`@ while (false) {} }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumLabelPrivate.kt b/js/js.translator/testData/box/reservedWords/enumLabelPrivate.kt deleted file mode 100644 index f1099348369..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumLabelPrivate.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val t: Int = 0 - - fun test() { - testRenamed("private", { private@ while (false) {} }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumLabelProtected.kt b/js/js.translator/testData/box/reservedWords/enumLabelProtected.kt deleted file mode 100644 index 9c89ac68fc0..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumLabelProtected.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val t: Int = 0 - - fun test() { - testRenamed("protected", { protected@ while (false) {} }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumValExtends.kt b/js/js.translator/testData/box/reservedWords/enumValExtends.kt deleted file mode 100644 index c140034ec4c..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumValExtends.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val extends: Int = 0 - - fun test() { - testNotRenamed("extends", { extends }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumValFinally.kt b/js/js.translator/testData/box/reservedWords/enumValFinally.kt deleted file mode 100644 index f46b8045d09..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumValFinally.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val finally: Int = 0 - - fun test() { - testNotRenamed("finally", { finally }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumValSuper.kt b/js/js.translator/testData/box/reservedWords/enumValSuper.kt deleted file mode 100644 index 5d8caad9e03..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumValSuper.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val `super`: Int = 0 - - fun test() { - testNotRenamed("super", { `super` }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumValThis.kt b/js/js.translator/testData/box/reservedWords/enumValThis.kt deleted file mode 100644 index 1c8f1cb09cd..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumValThis.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - val `this`: Int = 0 - - fun test() { - testNotRenamed("this", { `this` }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumVarFunction.kt b/js/js.translator/testData/box/reservedWords/enumVarFunction.kt deleted file mode 100644 index b9c710d5529..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumVarFunction.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - var function: Int = 0 - - fun test() { - testNotRenamed("function", { function }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumVarImplements.kt b/js/js.translator/testData/box/reservedWords/enumVarImplements.kt deleted file mode 100644 index b33e6926c14..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumVarImplements.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - var implements: Int = 0 - - fun test() { - testNotRenamed("implements", { implements }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumVarThrow.kt b/js/js.translator/testData/box/reservedWords/enumVarThrow.kt deleted file mode 100644 index f7eee0afda7..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumVarThrow.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - var `throw`: Int = 0 - - fun test() { - testNotRenamed("throw", { `throw` }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/enumVarTrue.kt b/js/js.translator/testData/box/reservedWords/enumVarTrue.kt deleted file mode 100644 index c227d249402..00000000000 --- a/js/js.translator/testData/box/reservedWords/enumVarTrue.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class Foo { - BAR; - var `true`: Int = 0 - - fun test() { - testNotRenamed("true", { `true` }) - } -} - -fun box(): String { - Foo.BAR.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunArguments.kt b/js/js.translator/testData/box/reservedWords/insideClassFunArguments.kt deleted file mode 100644 index 15837791eaf..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunArguments.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun arguments() { arguments() } - - fun test() { - testNotRenamed("arguments", { arguments() }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunAwait.kt b/js/js.translator/testData/box/reservedWords/insideClassFunAwait.kt deleted file mode 100644 index 569f0d44ec4..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunAwait.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun await() { await() } - - fun test() { - testNotRenamed("await", { await() }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunParamCase.kt b/js/js.translator/testData/box/reservedWords/insideClassFunParamCase.kt deleted file mode 100644 index c1dafa5ae75..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunParamCase.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun foo(case: String) { - assertEquals("123", case) - testRenamed("case", { case }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunParamCatch.kt b/js/js.translator/testData/box/reservedWords/insideClassFunParamCatch.kt deleted file mode 100644 index 5cb8d43853d..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunParamCatch.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun foo(catch: String) { - assertEquals("123", catch) - testRenamed("catch", { catch }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunParamThrow.kt b/js/js.translator/testData/box/reservedWords/insideClassFunParamThrow.kt deleted file mode 100644 index 88d42bff863..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunParamThrow.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun foo(`throw`: String) { - assertEquals("123", `throw`) - testRenamed("throw", { `throw` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunParamTrue.kt b/js/js.translator/testData/box/reservedWords/insideClassFunParamTrue.kt deleted file mode 100644 index 70e5deac1ac..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunParamTrue.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun foo(`true`: String) { - assertEquals("123", `true`) - testRenamed("true", { `true` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunSuper.kt b/js/js.translator/testData/box/reservedWords/insideClassFunSuper.kt deleted file mode 100644 index 5479c11d0c6..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunSuper.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun `super`() { `super`() } - - fun test() { - testNotRenamed("super", { `super`() }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassFunThis.kt b/js/js.translator/testData/box/reservedWords/insideClassFunThis.kt deleted file mode 100644 index 50ca6d192db..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassFunThis.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - fun `this`() { `this`() } - - fun test() { - testNotRenamed("this", { `this`() }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassLabelConst.kt b/js/js.translator/testData/box/reservedWords/insideClassLabelConst.kt deleted file mode 100644 index 79cb2312c02..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassLabelConst.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val t: Int = 0 - - fun test() { - testRenamed("const", { const@ while (false) {} }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassLabelDebugger.kt b/js/js.translator/testData/box/reservedWords/insideClassLabelDebugger.kt deleted file mode 100644 index a24ea8d8cbc..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassLabelDebugger.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val t: Int = 0 - - fun test() { - testRenamed("debugger", { debugger@ while (false) {} }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassLabelTry.kt b/js/js.translator/testData/box/reservedWords/insideClassLabelTry.kt deleted file mode 100644 index 07c9b54391a..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassLabelTry.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val t: Int = 0 - - fun test() { - testRenamed("try", { `try`@ while (false) {} }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassLabelTypeof.kt b/js/js.translator/testData/box/reservedWords/insideClassLabelTypeof.kt deleted file mode 100644 index 113f302ff3a..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassLabelTypeof.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val t: Int = 0 - - fun test() { - testRenamed("typeof", { `typeof`@ while (false) {} }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunContinue.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunContinue.kt deleted file mode 100644 index 1e62cea6422..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunContinue.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun `continue`() { `continue`() } - - fun test() { - testNotRenamed("continue", { `continue`() }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunDo.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunDo.kt deleted file mode 100644 index 8af680af5ef..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunDo.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun `do`() { `do`() } - - fun test() { - testNotRenamed("do", { `do`() }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunExport.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunExport.kt deleted file mode 100644 index 162d1c6cda7..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunExport.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun export() { export() } - - fun test() { - testNotRenamed("export", { export() }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunExtends.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunExtends.kt deleted file mode 100644 index b9d71e21a8d..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunExtends.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun extends() { extends() } - - fun test() { - testNotRenamed("extends", { extends() }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamElse.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamElse.kt deleted file mode 100644 index 95871050277..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamElse.kt +++ /dev/null @@ -1,22 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun foo(`else`: String) { - assertEquals("123", `else`) - testRenamed("else", { `else` }) -} - - fun test() { - foo("123") - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFalse.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFalse.kt deleted file mode 100644 index eff1ae92329..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFalse.kt +++ /dev/null @@ -1,22 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun foo(`false`: String) { - assertEquals("123", `false`) - testRenamed("false", { `false` }) -} - - fun test() { - foo("123") - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFinally.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFinally.kt deleted file mode 100644 index 49d06755924..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFinally.kt +++ /dev/null @@ -1,22 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun foo(finally: String) { - assertEquals("123", finally) - testRenamed("finally", { finally }) -} - - fun test() { - foo("123") - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFunction.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFunction.kt deleted file mode 100644 index 6cb1a32c879..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectFunParamFunction.kt +++ /dev/null @@ -1,22 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - fun foo(function: String) { - assertEquals("123", function) - testRenamed("function", { function }) -} - - fun test() { - foo("123") - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelFor.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectLabelFor.kt deleted file mode 100644 index 05291b6e0b4..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelFor.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val t: Int = 0 - - fun test() { - testRenamed("for", { `for`@ while (false) {} }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelIf.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectLabelIf.kt deleted file mode 100644 index c67c100a9c7..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelIf.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val t: Int = 0 - - fun test() { - testRenamed("if", { `if`@ while (false) {} }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImplements.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImplements.kt deleted file mode 100644 index a583fb6c7be..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImplements.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val t: Int = 0 - - fun test() { - testRenamed("implements", { implements@ while (false) {} }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImport.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImport.kt deleted file mode 100644 index 6e4b058c1c0..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectLabelImport.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val t: Int = 0 - - fun test() { - testRenamed("import", { import@ while (false) {} }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectValDefault.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectValDefault.kt deleted file mode 100644 index a62069c2a4b..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectValDefault.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val default: Int = 0 - - fun test() { - testNotRenamed("default", { default }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectValDelete.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectValDelete.kt deleted file mode 100644 index d23924c8d2e..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectValDelete.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val delete: Int = 0 - - fun test() { - testNotRenamed("delete", { delete }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectValVar.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectValVar.kt deleted file mode 100644 index 8cef16729de..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectValVar.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val `var`: Int = 0 - - fun test() { - testNotRenamed("var", { `var` }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectValWhile.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectValWhile.kt deleted file mode 100644 index 200055781ba..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectValWhile.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - val `while`: Int = 0 - - fun test() { - testNotRenamed("while", { `while` }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectVarBreak.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectVarBreak.kt deleted file mode 100644 index 1530c652230..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectVarBreak.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - var `break`: Int = 0 - - fun test() { - testNotRenamed("break", { `break` }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectVarClass.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectVarClass.kt deleted file mode 100644 index d9e49b844c6..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectVarClass.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - var `class`: Int = 0 - - fun test() { - testNotRenamed("class", { `class` }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectVarEnum.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectVarEnum.kt deleted file mode 100644 index 4bcab5f96ef..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectVarEnum.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - var enum: Int = 0 - - fun test() { - testNotRenamed("enum", { enum }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassObjectVarEval.kt b/js/js.translator/testData/box/reservedWords/insideClassObjectVarEval.kt deleted file mode 100644 index 68b8dc96059..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassObjectVarEval.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - companion object { - var eval: Int = 0 - - fun test() { - testNotRenamed("eval", { eval }) - } - } -} - -fun box(): String { - TestClass.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassValInfinity.kt b/js/js.translator/testData/box/reservedWords/insideClassValInfinity.kt deleted file mode 100644 index 690f9fd51f3..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassValInfinity.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val Infinity: Int = 0 - - fun test() { - testNotRenamed("Infinity", { Infinity }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassValInterface.kt b/js/js.translator/testData/box/reservedWords/insideClassValInterface.kt deleted file mode 100644 index 10ff41bc4e3..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassValInterface.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val `interface`: Int = 0 - - fun test() { - testNotRenamed("interface", { `interface` }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassValNull.kt b/js/js.translator/testData/box/reservedWords/insideClassValNull.kt deleted file mode 100644 index c79c8fdc0aa..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassValNull.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val `null`: Int = 0 - - fun test() { - testNotRenamed("null", { `null` }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassValYield.kt b/js/js.translator/testData/box/reservedWords/insideClassValYield.kt deleted file mode 100644 index 0b071cd9d58..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassValYield.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - val yield: Int = 0 - - fun test() { - testNotRenamed("yield", { yield }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassVarKotlin.kt b/js/js.translator/testData/box/reservedWords/insideClassVarKotlin.kt deleted file mode 100644 index 5cc4bf35e20..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassVarKotlin.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - var Kotlin: Int = 0 - - fun test() { - testNotRenamed("Kotlin", { Kotlin }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassVarNaN.kt b/js/js.translator/testData/box/reservedWords/insideClassVarNaN.kt deleted file mode 100644 index 70d69f10b74..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassVarNaN.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - var NaN: Int = 0 - - fun test() { - testNotRenamed("NaN", { NaN }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassVarPackage.kt b/js/js.translator/testData/box/reservedWords/insideClassVarPackage.kt deleted file mode 100644 index 8fc56bc984b..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassVarPackage.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - var `package`: Int = 0 - - fun test() { - testNotRenamed("package", { `package` }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideClassVarReturn.kt b/js/js.translator/testData/box/reservedWords/insideClassVarReturn.kt deleted file mode 100644 index 047ba1c5a1c..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideClassVarReturn.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class TestClass { - var `return`: Int = 0 - - fun test() { - testNotRenamed("return", { `return` }) - } -} - -fun box(): String { - TestClass().test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunParamStatic.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunParamStatic.kt deleted file mode 100644 index 82c990ecfe2..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunParamStatic.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun foo(static: String) { - assertEquals("123", static) - testRenamed("static", { static }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunParamSwitch.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunParamSwitch.kt deleted file mode 100644 index 9d99ce4a578..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunParamSwitch.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun foo(switch: String) { - assertEquals("123", switch) - testRenamed("switch", { switch }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunParamThis.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunParamThis.kt deleted file mode 100644 index 0b3dbd2ab79..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunParamThis.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun foo(`this`: String) { - assertEquals("123", `this`) - testRenamed("this", { `this` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunParamThrow.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunParamThrow.kt deleted file mode 100644 index 889a9be641b..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunParamThrow.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun foo(`throw`: String) { - assertEquals("123", `throw`) - testRenamed("throw", { `throw` }) -} - - fun test() { - foo("123") - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunProtected.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunProtected.kt deleted file mode 100644 index c791fe7debf..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunProtected.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun protected() { protected() } - - fun test() { - testNotRenamed("protected", { protected() }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunPublic.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunPublic.kt deleted file mode 100644 index e67db8bc791..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunPublic.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun public() { public() } - - fun test() { - testNotRenamed("public", { public() }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunReturn.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunReturn.kt deleted file mode 100644 index 9c8cc674dd4..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunReturn.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun `return`() { `return`() } - - fun test() { - testNotRenamed("return", { `return`() }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectFunSuper.kt b/js/js.translator/testData/box/reservedWords/insideObjectFunSuper.kt deleted file mode 100644 index d42af11e255..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectFunSuper.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - fun `super`() { `super`() } - - fun test() { - testNotRenamed("super", { `super`() }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectLabelTrue.kt b/js/js.translator/testData/box/reservedWords/insideObjectLabelTrue.kt deleted file mode 100644 index 45e5debe7e2..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectLabelTrue.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val t: Int = 0 - - fun test() { - testRenamed("true", { `true`@ while (false) {} }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectLabelTry.kt b/js/js.translator/testData/box/reservedWords/insideObjectLabelTry.kt deleted file mode 100644 index dac122e3026..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectLabelTry.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val t: Int = 0 - - fun test() { - testRenamed("try", { `try`@ while (false) {} }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectLabelUndefined.kt b/js/js.translator/testData/box/reservedWords/insideObjectLabelUndefined.kt deleted file mode 100644 index 690bb4e2eb7..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectLabelUndefined.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val t: Int = 0 - - fun test() { - testRenamed("undefined", { undefined@ while (false) {} }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectLabelVoid.kt b/js/js.translator/testData/box/reservedWords/insideObjectLabelVoid.kt deleted file mode 100644 index 69f2f74c739..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectLabelVoid.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val t: Int = 0 - - fun test() { - testRenamed("void", { void@ while (false) {} }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectValIn.kt b/js/js.translator/testData/box/reservedWords/insideObjectValIn.kt deleted file mode 100644 index 81d35823d23..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectValIn.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val `in`: Int = 0 - - fun test() { - testNotRenamed("in", { `in` }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectValInstanceof.kt b/js/js.translator/testData/box/reservedWords/insideObjectValInstanceof.kt deleted file mode 100644 index 94761e6d0da..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectValInstanceof.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val instanceof: Int = 0 - - fun test() { - testNotRenamed("instanceof", { instanceof }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectValInterface.kt b/js/js.translator/testData/box/reservedWords/insideObjectValInterface.kt deleted file mode 100644 index 9e4b5452df4..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectValInterface.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val `interface`: Int = 0 - - fun test() { - testNotRenamed("interface", { `interface` }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectValLet.kt b/js/js.translator/testData/box/reservedWords/insideObjectValLet.kt deleted file mode 100644 index bf7f5aab8ee..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectValLet.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - val let: Int = 0 - - fun test() { - testNotRenamed("let", { let }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectVarNew.kt b/js/js.translator/testData/box/reservedWords/insideObjectVarNew.kt deleted file mode 100644 index 9681e8cac11..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectVarNew.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - var new: Int = 0 - - fun test() { - testNotRenamed("new", { new }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectVarNull.kt b/js/js.translator/testData/box/reservedWords/insideObjectVarNull.kt deleted file mode 100644 index f1bcb915f36..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectVarNull.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - var `null`: Int = 0 - - fun test() { - testNotRenamed("null", { `null` }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectVarPackage.kt b/js/js.translator/testData/box/reservedWords/insideObjectVarPackage.kt deleted file mode 100644 index fc7f5bd6076..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectVarPackage.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - var `package`: Int = 0 - - fun test() { - testNotRenamed("package", { `package` }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/insideObjectVarPrivate.kt b/js/js.translator/testData/box/reservedWords/insideObjectVarPrivate.kt deleted file mode 100644 index 75e063e2bd6..00000000000 --- a/js/js.translator/testData/box/reservedWords/insideObjectVarPrivate.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object TestObject { - var private: Int = 0 - - fun test() { - testNotRenamed("private", { private }) - } -} - -fun box(): String { - TestObject.test() - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localCatchIf.kt b/js/js.translator/testData/box/reservedWords/localCatchIf.kt deleted file mode 100644 index 5c276229950..00000000000 --- a/js/js.translator/testData/box/reservedWords/localCatchIf.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - - - - try { - throw Exception() - } - catch(`if`: Exception) { - testRenamed("if", { `if` }) - } - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localCatchIn.kt b/js/js.translator/testData/box/reservedWords/localCatchIn.kt deleted file mode 100644 index de4d5599ec5..00000000000 --- a/js/js.translator/testData/box/reservedWords/localCatchIn.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - - - - try { - throw Exception() - } - catch(`in`: Exception) { - testRenamed("in", { `in` }) - } - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localCatchVoid.kt b/js/js.translator/testData/box/reservedWords/localCatchVoid.kt deleted file mode 100644 index 85fe86f5726..00000000000 --- a/js/js.translator/testData/box/reservedWords/localCatchVoid.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - - - - try { - throw Exception() - } - catch(void: Exception) { - testRenamed("void", { void }) - } - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localCatchWith.kt b/js/js.translator/testData/box/reservedWords/localCatchWith.kt deleted file mode 100644 index 31bc707453f..00000000000 --- a/js/js.translator/testData/box/reservedWords/localCatchWith.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - - - - try { - throw Exception() - } - catch(with: Exception) { - testRenamed("with", { with }) - } - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunClass.kt b/js/js.translator/testData/box/reservedWords/localFunClass.kt deleted file mode 100644 index 66eb91b88e1..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunClass.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun `class`() { `class`() } - - testRenamed("class", { `class`() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunContinue.kt b/js/js.translator/testData/box/reservedWords/localFunContinue.kt deleted file mode 100644 index 8e881f8fc89..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunContinue.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun `continue`() { `continue`() } - - testRenamed("continue", { `continue`() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunParamDo.kt b/js/js.translator/testData/box/reservedWords/localFunParamDo.kt deleted file mode 100644 index 6103b5d6777..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunParamDo.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun foo(`do`: String) { - assertEquals("123", `do`) - testRenamed("do", { `do` }) -} - - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunParamElse.kt b/js/js.translator/testData/box/reservedWords/localFunParamElse.kt deleted file mode 100644 index 1ff0b81d4e0..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunParamElse.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun foo(`else`: String) { - assertEquals("123", `else`) - testRenamed("else", { `else` }) -} - - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunParamPublic.kt b/js/js.translator/testData/box/reservedWords/localFunParamPublic.kt deleted file mode 100644 index d7d263c8e60..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunParamPublic.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun foo(public: String) { - assertEquals("123", public) - testRenamed("public", { public }) -} - - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunParamStatic.kt b/js/js.translator/testData/box/reservedWords/localFunParamStatic.kt deleted file mode 100644 index 609ae0a6743..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunParamStatic.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun foo(static: String) { - assertEquals("123", static) - testRenamed("static", { static }) -} - - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunPrivate.kt b/js/js.translator/testData/box/reservedWords/localFunPrivate.kt deleted file mode 100644 index 6bc18f5c15e..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunPrivate.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun private() { private() } - - testRenamed("private", { private() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localFunProtected.kt b/js/js.translator/testData/box/reservedWords/localFunProtected.kt deleted file mode 100644 index ff74f85f819..00000000000 --- a/js/js.translator/testData/box/reservedWords/localFunProtected.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - fun protected() { protected() } - - testRenamed("protected", { protected() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localLabelFalse.kt b/js/js.translator/testData/box/reservedWords/localLabelFalse.kt deleted file mode 100644 index 75c2826317e..00000000000 --- a/js/js.translator/testData/box/reservedWords/localLabelFalse.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val t: Int = 0 - - testRenamed("false", { `false`@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localLabelFor.kt b/js/js.translator/testData/box/reservedWords/localLabelFor.kt deleted file mode 100644 index 5ef639051df..00000000000 --- a/js/js.translator/testData/box/reservedWords/localLabelFor.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val t: Int = 0 - - testRenamed("for", { `for`@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localLabelSwitch.kt b/js/js.translator/testData/box/reservedWords/localLabelSwitch.kt deleted file mode 100644 index 244325b3ec6..00000000000 --- a/js/js.translator/testData/box/reservedWords/localLabelSwitch.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val t: Int = 0 - - testRenamed("switch", { switch@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localLabelUndefined.kt b/js/js.translator/testData/box/reservedWords/localLabelUndefined.kt deleted file mode 100644 index 27d949b2490..00000000000 --- a/js/js.translator/testData/box/reservedWords/localLabelUndefined.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val t: Int = 0 - - testRenamed("undefined", { undefined@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localValImport.kt b/js/js.translator/testData/box/reservedWords/localValImport.kt deleted file mode 100644 index 36f1542995c..00000000000 --- a/js/js.translator/testData/box/reservedWords/localValImport.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val import: Int = 0 - - testRenamed("import", { import }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localValInstanceof.kt b/js/js.translator/testData/box/reservedWords/localValInstanceof.kt deleted file mode 100644 index 88393fe974d..00000000000 --- a/js/js.translator/testData/box/reservedWords/localValInstanceof.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val instanceof: Int = 0 - - testRenamed("instanceof", { instanceof }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localValTypeof.kt b/js/js.translator/testData/box/reservedWords/localValTypeof.kt deleted file mode 100644 index ec32996855c..00000000000 --- a/js/js.translator/testData/box/reservedWords/localValTypeof.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val `typeof`: Int = 0 - - testRenamed("typeof", { `typeof` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localValVar.kt b/js/js.translator/testData/box/reservedWords/localValVar.kt deleted file mode 100644 index 2188f5450bb..00000000000 --- a/js/js.translator/testData/box/reservedWords/localValVar.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - val `var`: Int = 0 - - testRenamed("var", { `var` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localVarBreak.kt b/js/js.translator/testData/box/reservedWords/localVarBreak.kt deleted file mode 100644 index d4bb9493d02..00000000000 --- a/js/js.translator/testData/box/reservedWords/localVarBreak.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - var `break`: Int = 0 - - testRenamed("break", { `break` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localVarLet.kt b/js/js.translator/testData/box/reservedWords/localVarLet.kt deleted file mode 100644 index 1c0a71cf516..00000000000 --- a/js/js.translator/testData/box/reservedWords/localVarLet.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - var let: Int = 0 - - testRenamed("let", { let }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localVarNew.kt b/js/js.translator/testData/box/reservedWords/localVarNew.kt deleted file mode 100644 index efe8ef5a7cb..00000000000 --- a/js/js.translator/testData/box/reservedWords/localVarNew.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - var new: Int = 0 - - testRenamed("new", { new }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/localVarWhile.kt b/js/js.translator/testData/box/reservedWords/localVarWhile.kt deleted file mode 100644 index 1e3b71049da..00000000000 --- a/js/js.translator/testData/box/reservedWords/localVarWhile.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun box(): String { - var `while`: Int = 0 - - testRenamed("while", { `while` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelClassDelete.kt b/js/js.translator/testData/box/reservedWords/toplevelClassDelete.kt deleted file mode 100644 index e58769efae0..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelClassDelete.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class delete { companion object {} } - -fun box(): String { - testNotRenamed("delete", { delete }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelClassEnum.kt b/js/js.translator/testData/box/reservedWords/toplevelClassEnum.kt deleted file mode 100644 index 7bf579e7767..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelClassEnum.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class enum { companion object {} } - -fun box(): String { - testNotRenamed("enum", { enum }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelClassNull.kt b/js/js.translator/testData/box/reservedWords/toplevelClassNull.kt deleted file mode 100644 index 137bf900e53..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelClassNull.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class `null` { companion object {} } - -fun box(): String { - testNotRenamed("null", { `null` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelClassPackage.kt b/js/js.translator/testData/box/reservedWords/toplevelClassPackage.kt deleted file mode 100644 index 6a727997074..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelClassPackage.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -class `package` { companion object {} } - -fun box(): String { - testNotRenamed("package", { `package` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelEnumExtends.kt b/js/js.translator/testData/box/reservedWords/toplevelEnumExtends.kt deleted file mode 100644 index 09ec97f66c9..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelEnumExtends.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class extends { foo } - -fun box(): String { - testNotRenamed("extends", { extends.foo }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelEnumFinally.kt b/js/js.translator/testData/box/reservedWords/toplevelEnumFinally.kt deleted file mode 100644 index ac4abe6df9f..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelEnumFinally.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class finally { foo } - -fun box(): String { - testNotRenamed("finally", { finally.foo }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelEnumThis.kt b/js/js.translator/testData/box/reservedWords/toplevelEnumThis.kt deleted file mode 100644 index 92f922c8b84..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelEnumThis.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class `this` { foo } - -fun box(): String { - testNotRenamed("this", { `this`.foo }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelEnumThrow.kt b/js/js.translator/testData/box/reservedWords/toplevelEnumThrow.kt deleted file mode 100644 index 1e4e38a2757..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelEnumThrow.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -enum class `throw` { foo } - -fun box(): String { - testNotRenamed("throw", { `throw`.foo }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunAwait.kt b/js/js.translator/testData/box/reservedWords/toplevelFunAwait.kt deleted file mode 100644 index fe0350e4c25..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunAwait.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun await() { await() } - -fun box(): String { - testNotRenamed("await", { await() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunCase.kt b/js/js.translator/testData/box/reservedWords/toplevelFunCase.kt deleted file mode 100644 index a2a702b07cf..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunCase.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun case() { case() } - -fun box(): String { - testNotRenamed("case", { case() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunElse.kt b/js/js.translator/testData/box/reservedWords/toplevelFunElse.kt deleted file mode 100644 index 7228369ec24..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunElse.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun `else`() { `else`() } - -fun box(): String { - testNotRenamed("else", { `else`() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunFalse.kt b/js/js.translator/testData/box/reservedWords/toplevelFunFalse.kt deleted file mode 100644 index 9b520ff4662..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunFalse.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun `false`() { `false`() } - -fun box(): String { - testNotRenamed("false", { `false`() }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunParamCatch.kt b/js/js.translator/testData/box/reservedWords/toplevelFunParamCatch.kt deleted file mode 100644 index 69f7aaada02..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunParamCatch.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun foo(catch: String) { - assertEquals("123", catch) - testRenamed("catch", { catch }) -} - -fun box(): String { - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunParamConst.kt b/js/js.translator/testData/box/reservedWords/toplevelFunParamConst.kt deleted file mode 100644 index abef9541800..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunParamConst.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun foo(const: String) { - assertEquals("123", const) - testRenamed("const", { const }) -} - -fun box(): String { - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunParamFor.kt b/js/js.translator/testData/box/reservedWords/toplevelFunParamFor.kt deleted file mode 100644 index 6ae755a1420..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunParamFor.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun foo(`for`: String) { - assertEquals("123", `for`) - testRenamed("for", { `for` }) -} - -fun box(): String { - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelFunParamIf.kt b/js/js.translator/testData/box/reservedWords/toplevelFunParamIf.kt deleted file mode 100644 index 933ea3c9a85..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelFunParamIf.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -fun foo(`if`: String) { - assertEquals("123", `if`) - testRenamed("if", { `if` }) -} - -fun box(): String { - foo("123") - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelInterfaceEval.kt b/js/js.translator/testData/box/reservedWords/toplevelInterfaceEval.kt deleted file mode 100644 index c9cd901478b..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelInterfaceEval.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface eval { companion object {} } - -fun box(): String { - testNotRenamed("eval", { eval }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelInterfaceExport.kt b/js/js.translator/testData/box/reservedWords/toplevelInterfaceExport.kt deleted file mode 100644 index 17682ea0f96..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelInterfaceExport.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface export { companion object {} } - -fun box(): String { - testNotRenamed("export", { export }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelInterfaceReturn.kt b/js/js.translator/testData/box/reservedWords/toplevelInterfaceReturn.kt deleted file mode 100644 index 201cff82b78..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelInterfaceReturn.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface `return` { companion object {} } - -fun box(): String { - testNotRenamed("return", { `return` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelInterfaceSuper.kt b/js/js.translator/testData/box/reservedWords/toplevelInterfaceSuper.kt deleted file mode 100644 index ca068ef40c8..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelInterfaceSuper.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -interface `super` { companion object {} } - -fun box(): String { - testNotRenamed("super", { `super` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelLabelDebugger.kt b/js/js.translator/testData/box/reservedWords/toplevelLabelDebugger.kt deleted file mode 100644 index b7bad20c09d..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelLabelDebugger.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val t: Int = 0 - -fun box(): String { - testRenamed("debugger", { debugger@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelLabelDefault.kt b/js/js.translator/testData/box/reservedWords/toplevelLabelDefault.kt deleted file mode 100644 index f3a08256e24..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelLabelDefault.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val t: Int = 0 - -fun box(): String { - testRenamed("default", { default@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelLabelIn.kt b/js/js.translator/testData/box/reservedWords/toplevelLabelIn.kt deleted file mode 100644 index 2e96a7866e8..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelLabelIn.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val t: Int = 0 - -fun box(): String { - testRenamed("in", { `in`@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelLabelInterface.kt b/js/js.translator/testData/box/reservedWords/toplevelLabelInterface.kt deleted file mode 100644 index 0d06437d545..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelLabelInterface.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val t: Int = 0 - -fun box(): String { - testRenamed("interface", { `interface`@ while (false) {} }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelObjectFunction.kt b/js/js.translator/testData/box/reservedWords/toplevelObjectFunction.kt deleted file mode 100644 index 26c6ab5ec48..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelObjectFunction.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object function {} - -fun box(): String { - testNotRenamed("function", { function }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelObjectImplements.kt b/js/js.translator/testData/box/reservedWords/toplevelObjectImplements.kt deleted file mode 100644 index 89cef77b373..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelObjectImplements.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object implements {} - -fun box(): String { - testNotRenamed("implements", { implements }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelObjectTrue.kt b/js/js.translator/testData/box/reservedWords/toplevelObjectTrue.kt deleted file mode 100644 index 3c718d7e8c7..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelObjectTrue.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object `true` {} - -fun box(): String { - testNotRenamed("true", { `true` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelObjectTry.kt b/js/js.translator/testData/box/reservedWords/toplevelObjectTry.kt deleted file mode 100644 index a91352fd5ec..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelObjectTry.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -object `try` {} - -fun box(): String { - testNotRenamed("try", { `try` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelValBreak.kt b/js/js.translator/testData/box/reservedWords/toplevelValBreak.kt deleted file mode 100644 index 3134067ab92..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelValBreak.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val `break`: Int = 0 - -fun box(): String { - testNotRenamed("break", { `break` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelValClass.kt b/js/js.translator/testData/box/reservedWords/toplevelValClass.kt deleted file mode 100644 index b5211c38429..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelValClass.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val `class`: Int = 0 - -fun box(): String { - testNotRenamed("class", { `class` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelValInfinity.kt b/js/js.translator/testData/box/reservedWords/toplevelValInfinity.kt deleted file mode 100644 index f6dbd7f1359..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelValInfinity.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val Infinity: Int = 0 - -fun box(): String { - testNotRenamed("Infinity", { Infinity }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelValKotlin.kt b/js/js.translator/testData/box/reservedWords/toplevelValKotlin.kt deleted file mode 100644 index 112b6cf8730..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelValKotlin.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -val Kotlin: Int = 0 - -fun box(): String { - testNotRenamed("Kotlin", { Kotlin }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelVarArguments.kt b/js/js.translator/testData/box/reservedWords/toplevelVarArguments.kt deleted file mode 100644 index b5a78ada0f6..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelVarArguments.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -var arguments: Int = 0 - -fun box(): String { - testNotRenamed("arguments", { arguments }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelVarContinue.kt b/js/js.translator/testData/box/reservedWords/toplevelVarContinue.kt deleted file mode 100644 index 859c07d8ba6..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelVarContinue.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -var `continue`: Int = 0 - -fun box(): String { - testNotRenamed("continue", { `continue` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelVarDo.kt b/js/js.translator/testData/box/reservedWords/toplevelVarDo.kt deleted file mode 100644 index 348572489cd..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelVarDo.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -var `do`: Int = 0 - -fun box(): String { - testNotRenamed("do", { `do` }) - - return "OK" -} \ No newline at end of file diff --git a/js/js.translator/testData/box/reservedWords/toplevelVarNaN.kt b/js/js.translator/testData/box/reservedWords/toplevelVarNaN.kt deleted file mode 100644 index 26057400c28..00000000000 --- a/js/js.translator/testData/box/reservedWords/toplevelVarNaN.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -// NOTE THIS FILE IS AUTO-GENERATED by the generateTestDataForReservedWords.kt. DO NOT EDIT! - -var NaN: Int = 0 - -fun box(): String { - testNotRenamed("NaN", { NaN }) - - return "OK" -} \ No newline at end of file