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