JS backend: made JsInvocation arguments modifieable
This commit is contained in:
committed by
Zalim Bashorov
parent
96e5985ca9
commit
53fe237499
@@ -23,7 +23,7 @@ public final class JsInvocation extends JsExpressionImpl.JsExpressionHasArgument
|
||||
}
|
||||
|
||||
public JsInvocation(JsExpression qualifier, JsExpression arg) {
|
||||
this(qualifier, Collections.singletonList(arg));
|
||||
this(qualifier, new SmartList<JsExpression>(arg));
|
||||
}
|
||||
|
||||
public JsInvocation(JsExpression qualifier, JsExpression... arguments) {
|
||||
|
||||
+2
-1
@@ -34,12 +34,13 @@ import org.jetbrains.k2js.translate.reference.CallArgumentTranslator
|
||||
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.jet.lang.descriptors.Visibilities
|
||||
import org.jetbrains.jet.lang.psi.Call.CallType
|
||||
import com.intellij.util.SmartList
|
||||
import org.jetbrains.k2js.translate.utils.JsDescriptorUtils
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils
|
||||
|
||||
public fun addReceiverToArgs(receiver: JsExpression, arguments: List<JsExpression>): List<JsExpression> {
|
||||
if (arguments.isEmpty())
|
||||
return Collections.singletonList(receiver)
|
||||
return SmartList(receiver)
|
||||
|
||||
val argumentList = ArrayList<JsExpression>(1 + arguments.size())
|
||||
argumentList.add(receiver)
|
||||
|
||||
Reference in New Issue
Block a user