add binding for slice

This commit is contained in:
Matt Long
2018-06-20 17:46:10 -04:00
parent 0b80888c0d
commit e8bb0c2f98
2 changed files with 38 additions and 0 deletions

View File

@ -118,4 +118,12 @@ extern {
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
#[wasm_bindgen(method)]
pub fn join(this: &Array, delimiter: &str) -> String;
/// The slice() method returns a shallow copy of a portion of an array into a new array
/// object selected from begin to end (end not included).
/// The original array will not be modified.
///
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
#[wasm_bindgen(method)]
pub fn slice(this: &Array, start: u32, end: u32) -> Array;
}