JS: fix translation of call to suspend function with optional parameters

This commit is contained in:
Alexey Andreev
2016-11-07 18:26:25 +03:00
parent 3e436d42bf
commit 050a1e782e
@@ -21,6 +21,7 @@ import com.google.dart.compiler.backend.js.ast.metadata.SideEffectKind
import com.google.dart.compiler.backend.js.ast.metadata.sideEffects import com.google.dart.compiler.backend.js.ast.metadata.sideEffects
import com.intellij.util.SmartList import com.intellij.util.SmartList
import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.js.translate.context.Namer import org.jetbrains.kotlin.js.translate.context.Namer
@@ -157,7 +158,11 @@ class CallArgumentTranslator private constructor(
} }
} }
removeLastUndefinedArguments(result) val callableDescriptor = resolvedCall.resultingDescriptor
if (callableDescriptor !is FunctionDescriptor || !callableDescriptor.isSuspend) {
removeLastUndefinedArguments(result)
}
return ArgumentsInfo(result, hasSpreadOperator, cachedReceiver) return ArgumentsInfo(result, hasSpreadOperator, cachedReceiver)
} }