[JS IR BE] Support property accessors with @JsName

This commit is contained in:
Svyatoslav Kuzmich
2019-02-28 22:00:23 +03:00
parent c7f1238a07
commit 41bbd4d2d6
2 changed files with 3 additions and 2 deletions
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.ir.backend.js.utils.JsGenerationContext
import org.jetbrains.kotlin.ir.backend.js.utils.Namer
import org.jetbrains.kotlin.ir.backend.js.utils.getJsName
import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget
import org.jetbrains.kotlin.ir.declarations.IrClass
import org.jetbrains.kotlin.ir.declarations.IrConstructor
@@ -136,7 +137,8 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer<JsEx
val arguments = translateCallArguments(expression, context)
// Transform external property accessor call
if (function is IrSimpleFunction) {
// @JsName-annotated external property accessors are translated as function calls
if (function is IrSimpleFunction && function.getJsName() == null) {
val property = function.correspondingProperty
if (property != null && property.isEffectivelyExternal()) {
val nameRef = JsNameRef(context.getNameForDeclaration(property), jsDispatchReceiver)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JS_IR
// EXPECTED_REACHABLE_NODES: 1285
package foo