[JS IR] Concat varargs with non varargs on compile time for function w/o receiver

This commit is contained in:
Ilya Goncharov
2021-03-02 16:45:19 +03:00
parent fc559ab0cd
commit 7bbb5b77db
@@ -204,12 +204,19 @@ fun translateCall(
JsInvocation(iifeFun) JsInvocation(iifeFun)
} }
} }
} else {
if (argumentsAsSingleArray is JsArrayLiteral) {
JsInvocation(
JsNameRef(symbolName),
argumentsAsSingleArray.expressions
)
} else { } else {
JsInvocation( JsInvocation(
JsNameRef("apply", JsNameRef(symbolName)), JsNameRef("apply", JsNameRef(symbolName)),
listOf(JsNullLiteral(), argumentsAsSingleArray) listOf(JsNullLiteral(), argumentsAsSingleArray)
) )
} }
}
} else { } else {
JsInvocation(ref, listOfNotNull(jsExtensionReceiver) + arguments) JsInvocation(ref, listOfNotNull(jsExtensionReceiver) + arguments)
} }