mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 03:55:20 +03:00
js-sys: Add extends attributes for js_sys::Float64Array
address review comments add review comments
This commit is contained in:
parent
d9fbc48daa
commit
af9ecac296
@ -683,7 +683,6 @@ extern "C" {
|
||||
// Float32Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
// TODO Uncomment this once TypedArray is added:
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Float32Array;
|
||||
@ -737,8 +736,7 @@ extern "C" {
|
||||
// Float64Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
// TODO Uncomment this once TypedArray is added:
|
||||
// #[wasm_bindgen(extends = Object, extends = TypedArray)]
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Float64Array;
|
||||
|
||||
|
@ -13,6 +13,7 @@ macro_rules! each {
|
||||
$m!(Int16Array);
|
||||
$m!(Int32Array);
|
||||
$m!(Float32Array);
|
||||
$m!(Float64Array);
|
||||
)
|
||||
}
|
||||
|
||||
@ -20,6 +21,7 @@ macro_rules! test_inheritence {
|
||||
($arr:ident) => ({
|
||||
let arr = $arr::new(&JsValue::undefined());
|
||||
assert!(arr.is_instance_of::<$arr>());
|
||||
let _: &Object = arr.as_ref();
|
||||
assert!(arr.is_instance_of::<Object>());
|
||||
})
|
||||
}
|
||||
@ -28,20 +30,6 @@ fn 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 {
|
||||
($arr:ident) => ({
|
||||
let arr = $arr::new(&JsValue::undefined());
|
||||
|
Loading…
Reference in New Issue
Block a user