In javascript target with the IR backend the prope...
# javascript
r
In javascript target with the IR backend the properties are named differently in the js objects (with underscores and numbers), they used to be the same as the kotlin property names. Atm switching from legacy to IR breaks my application because I can not send a message anymore (to audio worker) as the json is now different. There is an annoration @JsName but that doesn't seem to work for the IR backend. Is there a way to overwrite these names?
b
With ir compiler you must now mark entities you want to export to js as @JsExport
Anything unmarked is mangled as you've observed
r
Ah, that's the trick. Thank you very much!
Hmm, didn't work after all. Looks like the IR backend doesn't pick it up or doesn't like ArrayBuffer as one of the types.
😕 1
The problem seems to be that in the IR backend the name export is done with methods on the prototype of the object. After sending the object to the AudioWorklet the prototype is lost so we can't access the properties through the exported name anymore. Workers will probably have the same problem.