-
Notifications
You must be signed in to change notification settings - Fork 37
Add JS as a target for kmp-nativecoroutines-core #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JS as a target for kmp-nativecoroutines-core #48
Conversation
@rickclephas Not sure if you want to merge this individually or wait until we add the logic to KSP IMO merging it now makes sense so we can make sure things don't drift too much as other changes get merged |
|
||
@Suppress("SuspendFunctionOnCoroutineScope") | ||
internal actual suspend fun CoroutineScope.runCurrent() { | ||
coroutineContext[Job]?.children?.forEach { it.join() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we should use runCurrent
from the TestScope
, so I guess we could just define it in commonMain
with a type check on the CoroutineScope
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (with the typecheck in nativeCoroutinesMain
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm looks like the coroutines-test classes aren't working as expected on JS 🤔
Hmm it was green before switching JS from |
@rickclephas I figured it out! What we really want to do is run all pending tasks, and keep advancing until there are no more tasks left to run. Replacing |
Part of #17 and #43
Doesn't add update any of KSP, but implements all
expect
s and gets tests passing for JS 😄