Skip to content

[Web API type definition issue] Wasm64 Support #2485

@daxpedda

Description

@daxpedda

Summary

WebAssembly.AddressValue should be number | bigint instead of number

Expected vs. Actual Behavior

There are a bunch of APIs relying on the type definition of WebAssembly.AddressValue:

  • WebAssembly.Memory.grow()
  • WebAssembly.Table.*
  • `WebAssembly.MemoryDescriptor.*
  • WebAssembly.TableDescriptor.*

With Wasm64 memory and tables can be 64-bit, requiring some of the parameters and properties to be bigint instead of number. Currently AddressValue is defines as number, but it should be number | bigint instead.

Maybe the API could be further improved with a separate table or memory type, in which the constructor with the help of WebAssembly.MemoryDescriptor or WebAssembly.TableDescriptor can determine which type we are dealing with.

Playground Link

No response

Browser Support

  • This API is supported in at least two major browser engines (not two Chromium-based browsers).

Have Tried The Latest Releases

  • This issue applies to the latest release of TypeScript.
  • This issue applies to the latest release of @types/web.

Additional Context

This has been explicitly overwritten internally here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions