Adding in to_vec method for typed arrays (#1844)

* Adding in to_vec method for typed arrays

* Fixing type error
This commit is contained in:
Pauan
2019-10-30 00:10:18 +01:00
committed by Alex Crichton
parent 6159d50eb6
commit 1f51831c3d
2 changed files with 33 additions and 15 deletions

View File

@ -131,3 +131,10 @@ fn copy_to() {
assert_eq!(*i, 5);
}
}
#[wasm_bindgen_test]
fn to_vec() {
let array = Int32Array::new(&10.into());
array.fill(5, 0, 10);
assert_eq!(array.to_vec(), vec![5, 5, 5, 5, 5, 5, 5, 5, 5, 5]);
}