https://kotlinlang.org logo
#javascript
Title
# javascript
g

Gopi S

11/16/2023, 12:17 PM
Hi Team, We are using KJS for our web app. In our case we had to suspend function. But when we use suspend function, we could not inspect variables in chrome. Its affects our development and a deal breaker too. Can someone suggest fix/workaround for this. https://youtrack.jetbrains.com/issue/KT-60837/KJS-Debugger-Could-not-inspect-evaluate-vairables-in-Chrome
t

turansky

11/16/2023, 1:37 PM
cc @Artem Kobzar
a

Artem Kobzar

11/16/2023, 6:05 PM
Unfortunately, this is the current limitation of the SourceMap format. With the regular function, it works fine just because all the variables inside the regular functions are compiled into JS variables with the same name, but with the suspend function, some of the variables are translated into StateMachine's fields. The situation with the debuggability of suspend functions should be much better when the ticket (https://youtrack.jetbrains.com/issue/KT-63038) arrives in the next version of the compiler.
I'm working to bring it in 2.0 version
👍 4
gratitude thank you 2
For now, you could try to inspect such variables by
this
object fields
e

Edoardo Luppi

11/16/2023, 9:46 PM
Do you aim at supporting this for all module systems or only for ES?
g

Gopi S

11/17/2023, 6:53 AM
Thanks a lot 👍
a

Artem Kobzar

11/17/2023, 8:09 AM
With all module systems.
5 Views