diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt index 27371156818..dae1fac0c3b 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -147,8 +147,6 @@ class JsIrBackendContext( // TODO: due to name clash those weird suffix is required, remove it once `MemberNameGenerator` is implemented private val COROUTINE_SUSPEND_OR_RETURN_JS_NAME = "suspendCoroutineUninterceptedOrReturnJS" private val GET_COROUTINE_CONTEXT_NAME = "getCoroutineContext" - - val callableClosureOrigin = object : IrDeclarationOriginImpl("CALLABLE_CLOSURE_DECLARATION") {} } private val internalPackage = module.getPackage(JS_PACKAGE_FQNAME) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt index 4fc0a9c513f..008b1db2e75 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt @@ -27,10 +27,8 @@ import org.jetbrains.kotlin.js.backend.ast.* @Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE") class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer { - override fun visitFunction(declaration: IrFunction, data: JsGenerationContext) = JsEmpty.also { - assert(declaration.origin == JsIrBackendContext.callableClosureOrigin) { - "The only possible Function Declaration is one composed in Callable Reference Lowering" - } + override fun visitFunction(declaration: IrFunction, data: JsGenerationContext): JsStatement { + error("All functions must be already lowered") } override fun visitBlockBody(body: IrBlockBody, context: JsGenerationContext): JsStatement {