You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Describe the Bug
The WebAssembly table can hold either
externref
oranyfunc
. However, the API injs-sys
usesFunction
in its methods, rather than the more permissiveJsValue
.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
The text was updated successfully, but these errors were encountered: