[JS IR] suport SuspendN.invoke functions
This commit is contained in:
committed by
TeamCityServer
parent
b684c2f8d7
commit
953089a4b9
+2
-3
@@ -62,9 +62,8 @@ class AddContinuationToFunctionCallsLowering(val context: JsCommonBackendContext
|
||||
}
|
||||
|
||||
val oldFun = expression.symbol.owner
|
||||
val newFun: IrSimpleFunction =
|
||||
context.mapping.suspendFunctionsToFunctionWithContinuations[oldFun]
|
||||
?: error("No mapping for ${oldFun.fqNameWhenAvailable}")
|
||||
// TODO: investigate why mapping might be unavailable for SuspendFunction4.invoke
|
||||
val newFun: IrSimpleFunction = oldFun.getOrCreateFunctionWithContinuationStub(context)
|
||||
|
||||
return irCall(
|
||||
expression,
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ private fun transformSuspendFunction(context: JsCommonBackendContext, function:
|
||||
}
|
||||
|
||||
|
||||
private fun IrSimpleFunction.getOrCreateFunctionWithContinuationStub(context: JsCommonBackendContext): IrSimpleFunction {
|
||||
fun IrSimpleFunction.getOrCreateFunctionWithContinuationStub(context: JsCommonBackendContext): IrSimpleFunction {
|
||||
return context.mapping.suspendFunctionsToFunctionWithContinuations.getOrPut(this) {
|
||||
createSuspendFunctionStub(context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user