mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 01:31:34 +00:00
Merge pull request #289 from wismer/array-iterator-method-bindings
Array iterator method bindings
This commit is contained in:
17
src/js.rs
17
src/js.rs
@ -195,5 +195,22 @@ 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;
|
||||
}
|
||||
|
||||
// Array Iterator
|
||||
#[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;
|
||||
|
||||
/// The entries() method returns a new Array Iterator object that contains the key/value pairs for each index in the array.
|
||||
///
|
||||
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries
|
||||
#[wasm_bindgen(method)]
|
||||
pub fn entries(this: &Array) -> ArrayIterator;
|
||||
}
|
Reference in New Issue
Block a user