add binding for keys method

This commit is contained in:
Matt Long
2018-06-21 17:00:02 -04:00
parent 0b29721194
commit 4cc73877a6
3 changed files with 45 additions and 0 deletions

View File

@ -195,5 +195,15 @@ extern {
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
#[wasm_bindgen(method)]
pub fn includes(this: &Array, value: JsValue, from_index: i32) -> bool;
}
#[wasm_bindgen]
extern {
pub type ArrayIterator;
/// The keys() method returns a new Array Iterator object that contains the keys for each index in the array.
///
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys
#[wasm_bindgen(method)]
pub fn keys(this: &Array) -> ArrayIterator;
}