From b678cc3c905283f65f203fc554c991578899fe90 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Fri, 25 Jun 2021 18:33:35 +0300 Subject: [PATCH] [JS IR] Fast return in boolean externals lowering - Put fqname when available instead of just name --- .../backend/js/lower/BooleanPropertyInExternalLowering.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BooleanPropertyInExternalLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BooleanPropertyInExternalLowering.kt index dfee55d628d..93e7d21b40e 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BooleanPropertyInExternalLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BooleanPropertyInExternalLowering.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.interpreter.toIrConst +import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable import org.jetbrains.kotlin.ir.util.isEffectivelyExternal import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid @@ -27,6 +28,7 @@ class BooleanPropertyInExternalLowering( ) : BodyLoweringPass { override fun lower(irBody: IrBody, container: IrDeclaration) { + if (!context.safeExternalBoolean && context.safeExternalBooleanDiagnostic == null) return irBody.transformChildrenVoid( ExternalBooleanPropertyProcessor( context @@ -78,7 +80,10 @@ class BooleanPropertyInExternalLowering( val call = JsIrBuilder.buildCall( target = function!! ).apply { - putValueArgument(0, property.name.identifier.toIrConst(context.irBuiltIns.stringType)) + putValueArgument( + 0, + property.fqNameWhenAvailable?.asString().toIrConst(context.irBuiltIns.stringType) + ) putValueArgument(1, irGet(tmp)) }