[Wasm] Fix KtDeclarationWithBody.hasValidJsCodeBody

Empty bodies are not valid jsCode bodies.
This commit is contained in:
Svyatoslav Kuzmich
2023-03-10 10:45:23 +01:00
committed by Space Team
parent c66f1a12cb
commit bb05c8528f
@@ -25,7 +25,7 @@ fun FunctionDescriptor.hasValidJsCodeBody(bindingContext: BindingContext): Boole
}
private fun KtDeclarationWithBody.hasValidJsCodeBody(bindingContext: BindingContext): Boolean {
if (!hasBody()) return true
if (!hasBody()) return false
val body = bodyExpression!!
return when {
!hasBlockBody() -> body.isJsCall(bindingContext)