[JS IR BE] Support property accessors with @JsName
This commit is contained in:
+3
-1
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.backend.js.transformers.irToJs
|
|||||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||||
import org.jetbrains.kotlin.ir.backend.js.utils.JsGenerationContext
|
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.Namer
|
||||||
|
import org.jetbrains.kotlin.ir.backend.js.utils.getJsName
|
||||||
import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget
|
import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrConstructor
|
import org.jetbrains.kotlin.ir.declarations.IrConstructor
|
||||||
@@ -136,7 +137,8 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer<JsEx
|
|||||||
val arguments = translateCallArguments(expression, context)
|
val arguments = translateCallArguments(expression, context)
|
||||||
|
|
||||||
// Transform external property accessor call
|
// 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
|
val property = function.correspondingProperty
|
||||||
if (property != null && property.isEffectivelyExternal()) {
|
if (property != null && property.isEffectivelyExternal()) {
|
||||||
val nameRef = JsNameRef(context.getNameForDeclaration(property), jsDispatchReceiver)
|
val nameRef = JsNameRef(context.getNameForDeclaration(property), jsDispatchReceiver)
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND: JS_IR
|
|
||||||
// EXPECTED_REACHABLE_NODES: 1285
|
// EXPECTED_REACHABLE_NODES: 1285
|
||||||
package foo
|
package foo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user