mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-17 02:30:50 +00:00
js-sys: Add extends attributes for js_sys::Uint8Array
This commit is contained in:
parent
f617dee794
commit
ea0ac134db
@ -2539,6 +2539,7 @@ extern {
|
||||
// Uint8Array
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type Uint8Array;
|
||||
|
||||
|
@ -1,7 +1,26 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
macro_rules! each {
|
||||
($m:ident) => (
|
||||
$m!(Uint8Array);
|
||||
)
|
||||
}
|
||||
|
||||
macro_rules! test_inheritence {
|
||||
($arr:ident) => ({
|
||||
let arr = $arr::new(&JsValue::undefined());
|
||||
assert!(arr.is_instance_of::<Uint8Array>());
|
||||
assert!(arr.is_instance_of::<Object>());
|
||||
})
|
||||
}
|
||||
#[wasm_bindgen_test]
|
||||
fn inheritence() {
|
||||
each!(test_inheritence);
|
||||
}
|
||||
|
||||
macro_rules! each {
|
||||
($m:ident) => (
|
||||
$m!(Uint8Array);
|
||||
|
Loading…
x
Reference in New Issue
Block a user