Open RunDevelopment opened 1 month ago
This is amazing work by the way, thank you!
I think it would be good to split off the bugfixes you made into a separate PR.
Will do.
I would also appreciate if you could do some code archeology into
instance.ptr
and see where this originated and the context around it.
Seems like the pointer field changed names a few times. 240d3cd1a1e9c5a75e8e1ae5a48469d8f229633e (7 years ago) changed it from __wasmPtr
to ptr
and dbea2a29e1ddf14d01bc16d370828cce409d2d11 (1 year ago) changed it from ptr
to __wbg_ptr
. So it's not that the author of _assertClass
used the wrong field name, the code of _assertClass
just wasn't updated when the pointer field was changed to the current __wbg_ptr
.
I also found https://github.com/rustwasm/wasm-bindgen/commit/5d697c196f46d8449b0654c326a6b70fb44b469d, which was the point where the return value stopped being used anymore but didn't get removed.
I added type annotations to a few commonly-used JS glue code functions. This makes it a lot easier to understand the glue, because I have TS to help me out.
Those type annotations also make it easier to verify the correctness of glue. And just to prove that: TS found 2 minor bugs in the JS glue code of our tests:
Fixes moved to #4192.
Aside from that, I did one additional change: I inline
lTextDecoder
:This just made typing easier, but the expression something to get used to...