Merge pull request #708 from sendilkumarn/extends-arr

Adds Extends to TypedArrays
This commit is contained in:
Sendil Kumar N
2018-08-15 23:45:04 +02:00
committed by GitHub
2 changed files with 23 additions and 4 deletions

View File

@ -1,5 +1,6 @@
use wasm_bindgen::prelude::*;
use wasm_bindgen_test::*;
use wasm_bindgen::JsCast;
use js_sys::*;
macro_rules! each {
@ -16,6 +17,19 @@ macro_rules! each {
)
}
macro_rules! test_inheritence {
($arr:ident) => ({
let arr = $arr::new(&JsValue::undefined());
assert!(arr.is_instance_of::<$arr>());
let _: &Object = arr.as_ref();
assert!(arr.is_instance_of::<Object>());
})
}
#[wasm_bindgen_test]
fn inheritence() {
each!(test_inheritence);
}
macro_rules! test_undefined {
($arr:ident) => ({
let arr = $arr::new(&JsValue::undefined());