https://kotlinlang.org logo
Title
a

Alexander Girke

04/07/2023, 1:00 PM
For those interested, i started to play around with the new Kotlin/Wasm target and running the output on Node.js: https://github.com/alxgrk/kotlin-nodejs-wasm-example/ Some questions that arose in the process: 1. Looks like there are currently no store/load methods for unsigned numbers in MemoryAllocator - i.e. load-/storeUByte, load-/storeUShort, etc. are missing. Is there already a Youtrack issue or something? 2. Is/will there be any way to specify the
importObject
for the generated
instantiate
JS method in tests?
s

Svyatoslav Kuzmich [JB]

04/07/2023, 2:48 PM
1. We started with minimal API. Please file an issue. In the meantime you can use
UInt.toInt()
and friends to get corresponding signed numbers with the same binary representation. 2.
instantiate
method takes import object as first parameter.
export async function instantiate(imports={}, runInitializer=true) { ... }
You can pass it from another JS module, but gradle plugin’s built-in test runner currently can’t use your custom entry JS module to run tests.
a

Alexander Girke

04/07/2023, 5:24 PM
Alright, thank you 👍