Add binding for Object.getOwnPropertyDescriptor()

This commit is contained in:
Michael Hoffmann
2018-09-16 22:55:15 +02:00
parent 2d5d485e46
commit b005e96fd9
2 changed files with 22 additions and 0 deletions

View File

@ -2022,6 +2022,15 @@ extern "C" {
#[wasm_bindgen(static_method_of = Object)]
pub fn freeze(value: &Object) -> Object;
/// The Object.getOwnPropertyDescriptor() method returns a
/// property descriptor for an own property (that is, one directly
/// present on an object and not in the object's prototype chain)
/// of a given object.
///
/// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor)
#[wasm_bindgen(static_method_of = Object, js_name = getOwnPropertyDescriptor)]
pub fn get_own_property_descriptor(obj: &Object, prop: &JsValue) -> JsValue;
/// The `hasOwnProperty()` method returns a boolean indicating whether the
/// object has the specified property as its own property (as opposed to
/// inheriting it).