mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 08:41:35 +00:00
@ -2128,6 +2128,7 @@ extern {
|
|||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[wasm_bindgen(extends = Object)]
|
||||||
pub type Reflect;
|
pub type Reflect;
|
||||||
|
|
||||||
/// The static `Reflect.apply()` method calls a target function with
|
/// 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 wasm_bindgen_test::*;
|
||||||
use js_sys::*;
|
use js_sys::*;
|
||||||
|
|
||||||
@ -180,3 +180,15 @@ fn set_prototype_of() {
|
|||||||
let obj = JsValue::from(obj);
|
let obj = JsValue::from(obj);
|
||||||
assert_eq!(JsValue::from(Reflect::get_prototype_of(&obj)), JsValue::null());
|
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();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user