From fb709cae92ac98c48e978367abac3ffc6731b8a4 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Mon, 29 Oct 2018 18:45:06 +0300 Subject: [PATCH] [JS IR BE] Fix private field names --- .../jetbrains/kotlin/ir/backend/js/utils/SimpleNameGenerator.kt | 1 + .../testData/codegen/box/closures/captureExtensionReceiver.kt | 1 - .../codegen/box/localClasses/inLocalExtensionFunction.kt | 1 - .../codegen/box/localClasses/inLocalExtensionProperty.kt | 1 - .../box/localClasses/localClassCaptureExtensionReceiver.kt | 1 - compiler/testData/codegen/box/operatorConventions/kt14201_2.kt | 1 - 6 files changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/SimpleNameGenerator.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/SimpleNameGenerator.kt index 9a90a826fbb..3678fc5090b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/SimpleNameGenerator.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/SimpleNameGenerator.kt @@ -135,6 +135,7 @@ class SimpleNameGenerator : NameGenerator { } else { nameBuilder.append('.') nameBuilder.append(getNameForDeclaration(declaration.parent as IrDeclaration, context)) + if (declaration.visibility == Visibilities.PRIVATE) nameDeclarator = context.currentScope::declareFreshName } } is IrClass -> { diff --git a/compiler/testData/codegen/box/closures/captureExtensionReceiver.kt b/compiler/testData/codegen/box/closures/captureExtensionReceiver.kt index c1108c0c9c9..bd78f48b9ef 100644 --- a/compiler/testData/codegen/box/closures/captureExtensionReceiver.kt +++ b/compiler/testData/codegen/box/closures/captureExtensionReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR interface B { val bar: T } diff --git a/compiler/testData/codegen/box/localClasses/inLocalExtensionFunction.kt b/compiler/testData/codegen/box/localClasses/inLocalExtensionFunction.kt index 8b92efd345f..d7231d40d3d 100644 --- a/compiler/testData/codegen/box/localClasses/inLocalExtensionFunction.kt +++ b/compiler/testData/codegen/box/localClasses/inLocalExtensionFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR package test class C(val s : String) { diff --git a/compiler/testData/codegen/box/localClasses/inLocalExtensionProperty.kt b/compiler/testData/codegen/box/localClasses/inLocalExtensionProperty.kt index a8c298a69f1..6a628f41320 100644 --- a/compiler/testData/codegen/box/localClasses/inLocalExtensionProperty.kt +++ b/compiler/testData/codegen/box/localClasses/inLocalExtensionProperty.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR package test class C(val s : String) { diff --git a/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt b/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt index 4c48f6fe404..b6708e33a90 100644 --- a/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt +++ b/compiler/testData/codegen/box/localClasses/localClassCaptureExtensionReceiver.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR class Outer { val foo = "Foo" diff --git a/compiler/testData/codegen/box/operatorConventions/kt14201_2.kt b/compiler/testData/codegen/box/operatorConventions/kt14201_2.kt index 34f5b1a4c11..b95b82d9172 100644 --- a/compiler/testData/codegen/box/operatorConventions/kt14201_2.kt +++ b/compiler/testData/codegen/box/operatorConventions/kt14201_2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JS_IR class A { val z: String = "OK" }