We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In javascript, it is possible to set the length of an array, why not allow it from the rust?
Just add this to Array externs in the js-sys crate.
#[wasm_bindgen(method, structural, setter)] pub fn set_length(this: &Array, value: u32);
Now one can use Reflect::set for this, but this is ugly.
The text was updated successfully, but these errors were encountered:
Also posted here: https://users.rust-lang.org/t/js-sys-set-array-length/87740
Sorry, something went wrong.
Add js_sys::Array::set_length
js_sys::Array::set_length
004cfa2
Fixes rustwasm#3244
979b335
Successfully merging a pull request may close this issue.
Motivation
In javascript, it is possible to set the length of an array, why not allow it from the rust?
Proposed Solution
Just add this to Array externs in the js-sys crate.
Alternatives
Now one can use Reflect::set for this, but this is ugly.
The text was updated successfully, but these errors were encountered: