Repository navigation
Type 64-bit WebAssembly memories and tables with bigint addresses - #2607
Open
Martin Ferret (MartinFerret) wants to merge 1 commit into
Open
Martin Ferret (MartinFerret) wants to merge 1 commit into
Martin Ferret (MartinFerret) wants to merge 1 commit into
Conversation
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.Suggestion cannot be applied right now. Please check back later.
Fixes #2485
64-bit memories and tables (
address: "i64") use bigints at runtime, but the types only accepted numbers, so valid code didn't compile.As agreed in the issue, numbers stay the default and bigints are only used when the descriptor says
address: "i64", the same way #2592 handlesshared.Memory,Tableand their descriptors get an address type parameter that defaults to"i32", so existing code keeps compiling.What can change for users:
WebAssembly.Memorynow prints with the extra type argument, which breaks the same three DefinitelyTyped tests as Type WebAssembly.Memory buffers as ArrayBufferLike for shared memories #2592. I'm sending a DefinitelyTyped PR for them first, like [blake2b-wasm, sha256-wasm, sha512-wasm] Accept a generic WebAssembly… DefinitelyTyped/DefinitelyTyped#76141.grow()andlengthcan be a number or a bigint.A new unit test covers the 64-bit cases and fails without the patch. The #2592 test passes unchanged,
npm testpasses, and the older outputs compile on TypeScript 5.5.4, 5.6.3 and 5.9.3.