mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 16:51:33 +00:00
js-sys: Add extends attributes for js_sys::Float64Array
address review comments add review comments
This commit is contained in:
@ -683,7 +683,6 @@ extern "C" {
|
|||||||
// Float32Array
|
// Float32Array
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// TODO Uncomment this once TypedArray is added:
|
|
||||||
#[wasm_bindgen(extends = Object)]
|
#[wasm_bindgen(extends = Object)]
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub type Float32Array;
|
pub type Float32Array;
|
||||||
@ -737,8 +736,7 @@ extern "C" {
|
|||||||
// Float64Array
|
// Float64Array
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
// TODO Uncomment this once TypedArray is added:
|
#[wasm_bindgen(extends = Object)]
|
||||||
// #[wasm_bindgen(extends = Object, extends = TypedArray)]
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub type Float64Array;
|
pub type Float64Array;
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ macro_rules! each {
|
|||||||
$m!(Int16Array);
|
$m!(Int16Array);
|
||||||
$m!(Int32Array);
|
$m!(Int32Array);
|
||||||
$m!(Float32Array);
|
$m!(Float32Array);
|
||||||
|
$m!(Float64Array);
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ macro_rules! test_inheritence {
|
|||||||
($arr:ident) => ({
|
($arr:ident) => ({
|
||||||
let arr = $arr::new(&JsValue::undefined());
|
let arr = $arr::new(&JsValue::undefined());
|
||||||
assert!(arr.is_instance_of::<$arr>());
|
assert!(arr.is_instance_of::<$arr>());
|
||||||
|
let _: &Object = arr.as_ref();
|
||||||
assert!(arr.is_instance_of::<Object>());
|
assert!(arr.is_instance_of::<Object>());
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -28,20 +30,6 @@ fn inheritence() {
|
|||||||
each!(test_inheritence);
|
each!(test_inheritence);
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! each {
|
|
||||||
($m:ident) => (
|
|
||||||
$m!(Uint8Array);
|
|
||||||
$m!(Uint8ClampedArray);
|
|
||||||
$m!(Uint16Array);
|
|
||||||
$m!(Uint32Array);
|
|
||||||
$m!(Int8Array);
|
|
||||||
$m!(Int16Array);
|
|
||||||
$m!(Int32Array);
|
|
||||||
$m!(Float32Array);
|
|
||||||
$m!(Float64Array);
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
macro_rules! test_undefined {
|
macro_rules! test_undefined {
|
||||||
($arr:ident) => ({
|
($arr:ident) => ({
|
||||||
let arr = $arr::new(&JsValue::undefined());
|
let arr = $arr::new(&JsValue::undefined());
|
||||||
|
Reference in New Issue
Block a user