mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 20:15:14 +03:00
Merge pull request #675 from sepiropht/master
[670] add extends for Array type
This commit is contained in:
commit
f85fd0e2ad
@ -1,5 +1,6 @@
|
||||
use wasm_bindgen::JsValue;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
macro_rules! js_array {
|
||||
@ -286,3 +287,9 @@ fn for_each() {
|
||||
assert_eq!(sum_indices_of_evens(&js_array![1, 3, 5, 7]), 0);
|
||||
assert_eq!(sum_indices_of_evens(&js_array![3, 5, 7, 10]), 3);
|
||||
}
|
||||
#[wasm_bindgen_test]
|
||||
fn array_inheritance() {
|
||||
let array = Array::new();
|
||||
assert!(array.is_instance_of::<Array>());
|
||||
assert!(array.is_instance_of::<Object>());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user