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
#[wasm_bindgen]
extern "C" {
#[wasm_bindgen(extends = Object)]
#[derive(Clone, Debug)]
pub type Uint8ClampedArray;

View File

@ -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::<Uint8Array>());
assert!(arr.is_instance_of::<$arr>());
assert!(arr.is_instance_of::<Object>());
})
}