Simplify JsInvocation in case we not it's Array

^KT-40689 fixed
This commit is contained in:
Shagen Ogandzhanian
2021-01-09 20:54:20 +01:00
committed by TeamCityServer
parent e98413740b
commit 6255f2bd77
@@ -171,6 +171,12 @@ fun translateCall(
JsBlock( JsBlock(
JsVars(JsVars.JsVar(receiverName, jsDispatchReceiver)), JsVars(JsVars.JsVar(receiverName, jsDispatchReceiver)),
JsReturn( JsReturn(
if (argumentsAsSingleArray is JsArrayLiteral) {
JsInvocation(
JsNameRef(symbolName, receiverRef),
argumentsAsSingleArray.expressions
)
} else {
JsInvocation( JsInvocation(
JsNameRef("apply", JsNameRef(symbolName, receiverRef)), JsNameRef("apply", JsNameRef(symbolName, receiverRef)),
listOf( listOf(
@@ -178,6 +184,7 @@ fun translateCall(
argumentsAsSingleArray argumentsAsSingleArray
) )
) )
}
) )
), ),
"VarargIIFE" "VarargIIFE"