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,13 +171,20 @@ fun translateCall(
JsBlock( JsBlock(
JsVars(JsVars.JsVar(receiverName, jsDispatchReceiver)), JsVars(JsVars.JsVar(receiverName, jsDispatchReceiver)),
JsReturn( JsReturn(
JsInvocation( if (argumentsAsSingleArray is JsArrayLiteral) {
JsNameRef("apply", JsNameRef(symbolName, receiverRef)), JsInvocation(
listOf( JsNameRef(symbolName, receiverRef),
receiverRef, argumentsAsSingleArray.expressions
argumentsAsSingleArray
) )
) } else {
JsInvocation(
JsNameRef("apply", JsNameRef(symbolName, receiverRef)),
listOf(
receiverRef,
argumentsAsSingleArray
)
)
}
) )
), ),
"VarargIIFE" "VarargIIFE"