[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
@@ -205,10 +205,17 @@ fun translateCall(
}
}
} else {
JsInvocation(
JsNameRef("apply", JsNameRef(symbolName)),
listOf(JsNullLiteral(), argumentsAsSingleArray)
)
if (argumentsAsSingleArray is JsArrayLiteral) {
JsInvocation(
JsNameRef(symbolName),
argumentsAsSingleArray.expressions
)
} else {
JsInvocation(
JsNameRef("apply", JsNameRef(symbolName)),
listOf(JsNullLiteral(), argumentsAsSingleArray)
)
}
}
} else {
JsInvocation(ref, listOfNotNull(jsExtensionReceiver) + arguments)