Brandon Saunders
01/30/2020, 1:46 AMglade
01/30/2020, 5:00 AMSvyatoslav Kuzmich [JB]
01/30/2020, 11:56 AMinternal
functions are exprted to JS in order to be tested from Kotlin/JS test module. They have specially mangled names and we don't recommend using them from JS manually.
In next release intenal
functions would not be exported to JavaScript at all. You would still be able to use them from K/JS test module.
I would recommend to either:
• Write unit tests in Kotlin
• Make them public
and use them in JS unit testsBrandon Saunders
01/30/2020, 7:26 PMSvyatoslav Kuzmich [JB]
01/30/2020, 10:27 PMinternal
declarations would be visible and fully functional within a single Kotlin module, and normally, not visible outside.
However, test Kotlin modules use a special compiler option to bypass this restriction and use internals from main module. This would continue to work just fine in new release.
What would not work is calling internals defined in Kotlin/JS from plain JavaScript code.
If i write something with an internal function that works on ios/android, will it break when it attempts to call the internal function?No, if you call internal function from Kotlin code it will work the same on all platforms.
Brandon Saunders
01/30/2020, 10:33 PMSvyatoslav Kuzmich [JB]
01/30/2020, 10:36 PM