https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
m

martmists

09/20/2023, 8:38 PM
I'm trying to make a multiplatform WeakrefMap, but for some reason WeakRef/WeakMap is not available on the JS target. What can I do instead?
e

ephemient

09/20/2023, 8:48 PM
the WeakRef proposal for JS was only accepted for ES12 and Kotlin/JS still targets ES5, so you can't really do anything (in a cross-platform safe way)
m

martmists

09/20/2023, 10:37 PM
But isn't it already available in every browser and nodejs? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
e

ephemient

09/20/2023, 11:13 PM
Kotlin/JS isn't up to date with the latest JS standards
m

martmists

09/21/2023, 7:52 AM
I see, so there's currently no way to have a weakmap equivalent in Kotlin/JS?