Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebAssembly.Table methods are incorrect #3708

Open
ten3roberts opened this issue Nov 15, 2023 · 1 comment
Open

WebAssembly.Table methods are incorrect #3708

ten3roberts opened this issue Nov 15, 2023 · 1 comment
Labels

Comments

@ten3roberts
Copy link

Describe the Bug

The WebAssembly table can hold either externref or anyfunc. However, the API in js-sys uses Function in its methods, rather than the more permissive JsValue.

Additionally, functions accepting a second parameter are not reflected, such as the constructor, and the grow method which can take a second (optional) init parameter.

The API should ideally reflect the JavaScript API and allow for these use cases

Additional Context

Add any other context about the problem here.

MDN documentation: https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Table
Js-sys documentation: https://docs.rs/js-sys/0.3.65/js_sys/WebAssembly/struct.Table.html

@daxpedda
Copy link
Collaborator

grow() (and others with missing optional parameters) could be amended by just adding new methods.

For get() and set(), we either do a breaking change, considering these are already broken to some degree, or just introduce new methods that take and return new types.
Right now at least I don't see why we would break those, adding new methods sounds good to me, we could even deprecate the old ones.

Happy to review a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants