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:
Alex Crichton
2019-02-13 13:10:40 -06:00
committed by GitHub
2 changed files with 60 additions and 0 deletions

View File

@ -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.
///