mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-17 02:30:50 +00:00
parent
bfff8661c1
commit
66d155d708
@ -2128,6 +2128,7 @@ extern {
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[derive(Clone, Debug)]
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
pub type Reflect;
|
||||
|
||||
/// The static `Reflect.apply()` method calls a target function with
|
||||
|
@ -1,4 +1,4 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen::{JsCast, prelude::*};
|
||||
use wasm_bindgen_test::*;
|
||||
use js_sys::*;
|
||||
|
||||
@ -180,3 +180,15 @@ fn set_prototype_of() {
|
||||
let obj = JsValue::from(obj);
|
||||
assert_eq!(JsValue::from(Reflect::get_prototype_of(&obj)), JsValue::null());
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn reflect_extends() {
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
#[wasm_bindgen(js_name = Reflect)]
|
||||
static reflect: Reflect;
|
||||
}
|
||||
|
||||
assert!(reflect.is_instance_of::<Object>());
|
||||
let _: &Object = reflect.as_ref();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user