@@ -4657,7 +4657,7 @@ pub fn global() -> Object {
4657
4657
}
4658
4658
4659
4659
macro_rules! arrays {
4660
- ( $( #[ doc = $ctor: literal] #[ doc = $mdn: literal] $name: ident: $ty: ident => $zero : literal , ) * ) => ( $(
4660
+ ( $( #[ doc = $ctor: literal] #[ doc = $mdn: literal] $name: ident: $ty: ident, ) * ) => ( $(
4661
4661
#[ wasm_bindgen]
4662
4662
extern "C" {
4663
4663
#[ wasm_bindgen( extends = Object ) ]
@@ -4843,7 +4843,7 @@ macro_rules! arrays {
4843
4843
4844
4844
/// Efficiently copies the contents of this JS typed array into a new Vec.
4845
4845
pub fn to_vec( & self ) -> Vec <$ty> {
4846
- let mut output = vec![ $zero ; self . length( ) as usize ] ;
4846
+ let mut output = vec![ $ty :: default ( ) ; self . length( ) as usize ] ;
4847
4847
self . raw_copy_to( & mut output) ;
4848
4848
output
4849
4849
}
@@ -4862,37 +4862,37 @@ macro_rules! arrays {
4862
4862
arrays ! {
4863
4863
/// `Int8Array()`
4864
4864
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
4865
- Int8Array : i8 => 0 ,
4865
+ Int8Array : i8 ,
4866
4866
4867
4867
/// `Int16Array()`
4868
4868
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array
4869
- Int16Array : i16 => 0 ,
4869
+ Int16Array : i16 ,
4870
4870
4871
4871
/// `Int32Array()`
4872
4872
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array
4873
- Int32Array : i32 => 0 ,
4873
+ Int32Array : i32 ,
4874
4874
4875
4875
/// `Uint8Array()`
4876
4876
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
4877
- Uint8Array : u8 => 0 ,
4877
+ Uint8Array : u8 ,
4878
4878
4879
4879
/// `Uint8ClampedArray()`
4880
4880
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray
4881
- Uint8ClampedArray : u8 => 0 ,
4881
+ Uint8ClampedArray : u8 ,
4882
4882
4883
4883
/// `Uint16Array()`
4884
4884
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array
4885
- Uint16Array : u16 => 0 ,
4885
+ Uint16Array : u16 ,
4886
4886
4887
4887
/// `Uint32Array()`
4888
4888
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array
4889
- Uint32Array : u32 => 0 ,
4889
+ Uint32Array : u32 ,
4890
4890
4891
4891
/// `Float32Array()`
4892
4892
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array
4893
- Float32Array : f32 => 0.0 ,
4893
+ Float32Array : f32 ,
4894
4894
4895
4895
/// `Float64Array()`
4896
4896
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array
4897
- Float64Array : f64 => 0.0 ,
4897
+ Float64Array : f64 ,
4898
4898
}
0 commit comments