diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 7bdcc9d0..93b0923a 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -2592,6 +2592,7 @@ extern "C" { // Uint8ClampedArray #[wasm_bindgen] extern "C" { + #[wasm_bindgen(extends = Object)] #[derive(Clone, Debug)] pub type Uint8ClampedArray; diff --git a/crates/js-sys/tests/wasm/TypedArray.rs b/crates/js-sys/tests/wasm/TypedArray.rs index ac9dcaba..458feca8 100644 --- a/crates/js-sys/tests/wasm/TypedArray.rs +++ b/crates/js-sys/tests/wasm/TypedArray.rs @@ -6,13 +6,14 @@ use js_sys::*; macro_rules! each { ($m:ident) => ( $m!(Uint8Array); + $m!(Uint8ClampedArray); ) } macro_rules! test_inheritence { ($arr:ident) => ({ let arr = $arr::new(&JsValue::undefined()); - assert!(arr.is_instance_of::()); + assert!(arr.is_instance_of::<$arr>()); assert!(arr.is_instance_of::()); }) }