From 2979618842f15144e119e32da0f3a00e7604deea Mon Sep 17 00:00:00 2001 From: Sendil Kumar Date: Tue, 14 Aug 2018 19:31:49 +0200 Subject: [PATCH] js-sys: Add extends attributes for js_sys::UInt8ClampedArray --- crates/js-sys/src/lib.rs | 1 + crates/js-sys/tests/wasm/TypedArray.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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::()); }) }