[JS IR] Fix access to coroutine empty context for suspend main
This commit is contained in:
@@ -264,7 +264,7 @@ class JsIrBackendContext(
|
|||||||
val coroutineGetContextJs
|
val coroutineGetContextJs
|
||||||
get() = ir.symbols.coroutineGetContext
|
get() = ir.symbols.coroutineGetContext
|
||||||
|
|
||||||
val coroutineEmptyContinuation = symbolTable.referenceField(getProperty(FqName.fromSegments(listOf("kotlin", "coroutines", "js", "internal", "EmptyContinuation"))))
|
val coroutineEmptyContinuation = symbolTable.referenceProperty(getProperty(FqName.fromSegments(listOf("kotlin", "coroutines", "js", "internal", "EmptyContinuation"))))
|
||||||
|
|
||||||
val coroutineContextProperty: PropertyDescriptor
|
val coroutineContextProperty: PropertyDescriptor
|
||||||
get() {
|
get() {
|
||||||
|
|||||||
+1
-1
@@ -185,7 +185,7 @@ class IrModuleToJsTransformer(
|
|||||||
if (mainFunction.valueParameters.isNotEmpty()) JsArrayLiteral(mainArguments.map { JsStringLiteral(it) }) else null
|
if (mainFunction.valueParameters.isNotEmpty()) JsArrayLiteral(mainArguments.map { JsStringLiteral(it) }) else null
|
||||||
|
|
||||||
val continuation = if (mainFunction.isSuspend) {
|
val continuation = if (mainFunction.isSuspend) {
|
||||||
val emptyContinuationField = backendContext.coroutineEmptyContinuation.owner
|
val emptyContinuationField = backendContext.coroutineEmptyContinuation.owner.backingField!!
|
||||||
rootContext.getNameForField(emptyContinuationField).makeRef()
|
rootContext.getNameForField(emptyContinuationField).makeRef()
|
||||||
} else null
|
} else null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user