Skip to content

Commit

Permalink
[JS IR] Continuation parameter in main through accessor
Browse files Browse the repository at this point in the history
^KT-43222 fixed
  • Loading branch information
ilgonmic committed Nov 24, 2020
1 parent 34ee146 commit f4c1e52
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ class IrModuleToJsTransformer(
if (mainFunction.valueParameters.isNotEmpty()) JsArrayLiteral(mainArguments.map { JsStringLiteral(it) }) else null

val continuation = if (mainFunction.isSuspend) {
val emptyContinuationField = backendContext.coroutineEmptyContinuation.owner.backingField!!
rootContext.getNameForField(emptyContinuationField).makeRef()
backendContext.coroutineEmptyContinuation.owner
.let { it.getter!! }
.let { rootContext.getNameForStaticFunction(it) }
.let { JsInvocation(it.makeRef()) }
} else null

return listOfNotNull(mainArgumentsArray, continuation)
Expand Down

0 comments on commit f4c1e52

Please sign in to comment.