add bindings for unshift

This commit is contained in:
Matt Long
2018-06-20 18:06:08 -04:00
parent 68acbeab25
commit 3cf522d2df
2 changed files with 37 additions and 0 deletions

View File

@ -165,4 +165,10 @@ extern {
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
#[wasm_bindgen(method)]
pub fn shift(this: &Array) -> JsValue;
/// The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.
///
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift
#[wasm_bindgen(method)]
pub fn unshift(this: &Array, value: JsValue) -> u32;
}