Fix byte order for big-endian platforms#4015
Conversation
1c10293 to
85877e3
Compare
d15a159 to
0b99b3e
Compare
> [!NOTE] > We should remove this if wasm-bindgen/wasm-bindgen#4015 get mereged.
|
Could you review this pull request? @daxpedda |
4ca91d6 to
fabe89c
Compare
daxpedda
left a comment
There was a problem hiding this comment.
I'm a bit confused why you chose not to re-use expose_*_memory().
The only place it still seems to be used is for importing arrays, which you actually haven't covered here.
I will have more time tomorrow to look into this properly.
Could you review this pull request? @daxpedda
I apologize for the delay, my backlog from my vacation was quite big and I'm just getting to it.
Could you please specify which part you're referring to? Marking it on the relevant code would be helpful. |
|
All these functions could be adapted: The corresponding |
5f93ead to
925fc07
Compare
Note
WebAssembly memory is always in little-endian format, regardless of the platform it's run on. Therefore, for portability, you should read and write multi-byte values in JavaScript using DataView.
https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory
Related issues:
@swc/wasm-typescriptis failing on some architectures swc-project/swc#9259