mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-14 05:21:24 +00:00
Merge pull request #1225 from Pauan/get_index
Adding in Reflect::get_f64, Reflect::get_u32, Reflect::set_f64, and Reflect::set_u32
This commit is contained in:
@ -2654,6 +2654,14 @@ extern "C" {
|
||||
#[wasm_bindgen(static_method_of = Reflect, catch)]
|
||||
pub fn get(target: &JsValue, key: &JsValue) -> Result<JsValue, JsValue>;
|
||||
|
||||
/// The same as [`Reflect::get`](#method.get) except the key is an `f64`, which is slightly faster.
|
||||
#[wasm_bindgen(static_method_of = Reflect, js_name = "get", catch)]
|
||||
pub fn get_f64(target: &JsValue, key: f64) -> Result<JsValue, JsValue>;
|
||||
|
||||
/// The same as [`Reflect::get`](#method.get) except the key is a `u32`, which is slightly faster.
|
||||
#[wasm_bindgen(static_method_of = Reflect, js_name = "get", catch)]
|
||||
pub fn get_u32(target: &JsValue, key: u32) -> Result<JsValue, JsValue>;
|
||||
|
||||
/// The static `Reflect.getOwnPropertyDescriptor()` method is similar to
|
||||
/// `Object.getOwnPropertyDescriptor()`. It returns a property descriptor
|
||||
/// of the given property if it exists on the object, `undefined` otherwise.
|
||||
@ -2712,6 +2720,14 @@ extern "C" {
|
||||
#[wasm_bindgen(static_method_of = Reflect, catch)]
|
||||
pub fn set(target: &JsValue, property_key: &JsValue, value: &JsValue) -> Result<bool, JsValue>;
|
||||
|
||||
/// The same as [`Reflect::set`](#method.set) except the key is an `f64`, which is slightly faster.
|
||||
#[wasm_bindgen(static_method_of = Reflect, js_name = "set", catch)]
|
||||
pub fn set_f64(target: &JsValue, property_key: f64, value: &JsValue) -> Result<bool, JsValue>;
|
||||
|
||||
/// The same as [`Reflect::set`](#method.set) except the key is a `u32`, which is slightly faster.
|
||||
#[wasm_bindgen(static_method_of = Reflect, js_name = "set", catch)]
|
||||
pub fn set_u32(target: &JsValue, property_key: u32, value: &JsValue) -> Result<bool, JsValue>;
|
||||
|
||||
/// The static `Reflect.set()` method works like setting a
|
||||
/// property on an object.
|
||||
///
|
||||
|
Reference in New Issue
Block a user