js-sys: Add extends attributes for js_sys::UInt8ClampedArray

This commit is contained in:
Sendil Kumar 2018-08-14 19:31:49 +02:00
parent ea0ac134db
commit 2979618842
2 changed files with 3 additions and 1 deletions

View File

@ -2592,6 +2592,7 @@ extern "C" {
// Uint8ClampedArray // Uint8ClampedArray
#[wasm_bindgen] #[wasm_bindgen]
extern "C" { extern "C" {
#[wasm_bindgen(extends = Object)]
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub type Uint8ClampedArray; pub type Uint8ClampedArray;

View File

@ -6,13 +6,14 @@ use js_sys::*;
macro_rules! each { macro_rules! each {
($m:ident) => ( ($m:ident) => (
$m!(Uint8Array); $m!(Uint8Array);
$m!(Uint8ClampedArray);
) )
} }
macro_rules! test_inheritence { 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::<Uint8Array>()); assert!(arr.is_instance_of::<$arr>());
assert!(arr.is_instance_of::<Object>()); assert!(arr.is_instance_of::<Object>());
}) })
} }