Add i64
to the set of JS-compatible wasm types in syncWebAssembly
mode
#16339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
For quite a while now, it's been possible for WebAssembly
i64
s to be converted to/from JS bigints (as function parameters, results, etc.). However,syncWebAssembly
mode currently rejects any modules that attempt to do so, becausei64
isn't in it's list of JS-compatible types. This fixes that by addingi64
to that list.Fixes #8531, although that was already closed from inactivity.
(Note: this fix is mainly meant for being backported to webpack 4, since
syncWebAssembly
is deprecated anyway, but I've implemented it against webpack 5 first.)This caused rustwasm/wasm-bindgen#3095 when
wasm-bindgen
switched to directly pass 64-bit integers asi64
s rather than as a pair ofi32
s; that issue is mostly about webpack 4, though, so this'll need to be backported before that's fixed.There was an existing test that used
i64
as an example of a non-JS-compatible type; I replaced that withv128
.