js: Add bindings to Object.keys

This commit is contained in:
Nick Fitzgerald
2018-06-22 14:45:33 -07:00
parent 21fa3beabd
commit eb04d15a65
2 changed files with 34 additions and 0 deletions

View File

@ -293,6 +293,13 @@ extern {
#[wasm_bindgen(method, js_name = isPrototypeOf)]
pub fn is_prototype_of(this: &Object, value: &JsValue) -> bool;
/// The Object.keys() method returns an array of a given object's property
/// names, in the same order as we get with a normal loop.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
#[wasm_bindgen(static_method_of = Object)]
pub fn keys(object: &Object) -> Array;
/// The Object constructor creates an object wrapper.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object