Skip to content
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

ScopeRegistry.closeAllScopes() causes ConcurrentModificationException for JS #1963

Open
luozejiaqun opened this issue Sep 3, 2024 · 2 comments · May be fixed by #2032
Open

ScopeRegistry.closeAllScopes() causes ConcurrentModificationException for JS #1963

luozejiaqun opened this issue Sep 3, 2024 · 2 comments · May be fixed by #2032

Comments

@luozejiaqun
Copy link

luozejiaqun commented Sep 3, 2024

Same issue to #1711 in JS platform. And the fix #1799 does't work for JS.
Here is the js closeAllScopes generated code:

private fun closeAllScopes() {
    _scopes.values.toList().forEach { scope ->
        scope.close()
    }
}
function closeAllScopes($this) {
  // Inline function 'kotlin.collections.forEach' call
  var tmp0_iterator = $this._scopes_1.get_values_ksazhn_k$().iterator_jk1svi_k$();
  while (tmp0_iterator.hasNext_bitz1p_k$()) {
    var element = tmp0_iterator.next_20eer_k$();
    // Inline function 'org.koin.core.registry.ScopeRegistry.closeAllScopes.<anonymous>' call
    element.close_yn9xrc_k$();
  }
}

the method toList makes no sense to js.

@luozejiaqun
Copy link
Author

Instead of toList, maybe mapTo another list will help.

@arnaudgiuliani
Copy link
Member

I need to double-check with JetBrains team on this point, why it's producing such code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants