mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-02 02:11:06 +00:00
js: Sort Array bindings alphabetically
This commit is contained in:
parent
552f3c7c66
commit
0f7db31888
42
src/js.rs
42
src/js.rs
@ -117,14 +117,12 @@ extern {
|
|||||||
#[wasm_bindgen(method)]
|
#[wasm_bindgen(method)]
|
||||||
pub fn filter(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> Array;
|
pub fn filter(this: &Array, predicate: &mut FnMut(JsValue, u32, Array) -> bool) -> Array;
|
||||||
|
|
||||||
/// The length property of an object which is an instance of type Array
|
/// The includes() method determines whether an array includes a certain
|
||||||
/// sets or returns the number of elements in that array. The value is an
|
/// element, returning true or false as appropriate.
|
||||||
/// unsigned, 32-bit integer that is always numerically greater than the
|
|
||||||
/// highest index in the array.
|
|
||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length
|
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
|
||||||
#[wasm_bindgen(method, getter, structural)]
|
#[wasm_bindgen(method)]
|
||||||
pub fn length(this: &Array) -> u32;
|
pub fn includes(this: &Array, value: JsValue, from_index: i32) -> bool;
|
||||||
|
|
||||||
/// The indexOf() method returns the first index at which a given element
|
/// The indexOf() method returns the first index at which a given element
|
||||||
/// can be found in the array, or -1 if it is not present.
|
/// can be found in the array, or -1 if it is not present.
|
||||||
@ -133,13 +131,6 @@ extern {
|
|||||||
#[wasm_bindgen(method, js_name = indexOf)]
|
#[wasm_bindgen(method, js_name = indexOf)]
|
||||||
pub fn index_of(this: &Array, value: JsValue, from_index: i32) -> i32;
|
pub fn index_of(this: &Array, value: JsValue, from_index: i32) -> i32;
|
||||||
|
|
||||||
/// The includes() method determines whether an array includes a certain
|
|
||||||
/// element, returning true or false as appropriate.
|
|
||||||
///
|
|
||||||
/// 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;
|
|
||||||
|
|
||||||
/// The join() method joins all elements of an array (or an array-like object)
|
/// The join() method joins all elements of an array (or an array-like object)
|
||||||
/// into a string and returns this string.
|
/// into a string and returns this string.
|
||||||
///
|
///
|
||||||
@ -155,6 +146,15 @@ extern {
|
|||||||
#[wasm_bindgen(method, js_name = lastIndexOf)]
|
#[wasm_bindgen(method, js_name = lastIndexOf)]
|
||||||
pub fn last_index_of(this: &Array, value: JsValue, from_index: i32) -> i32;
|
pub fn last_index_of(this: &Array, value: JsValue, from_index: i32) -> i32;
|
||||||
|
|
||||||
|
/// The length property of an object which is an instance of type Array
|
||||||
|
/// sets or returns the number of elements in that array. The value is an
|
||||||
|
/// unsigned, 32-bit integer that is always numerically greater than the
|
||||||
|
/// highest index in the array.
|
||||||
|
///
|
||||||
|
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length
|
||||||
|
#[wasm_bindgen(method, getter, structural)]
|
||||||
|
pub fn length(this: &Array) -> u32;
|
||||||
|
|
||||||
/// The pop() method removes the last element from an array and returns that
|
/// The pop() method removes the last element from an array and returns that
|
||||||
/// element. This method changes the length of the array.
|
/// element. This method changes the length of the array.
|
||||||
///
|
///
|
||||||
@ -176,6 +176,13 @@ extern {
|
|||||||
#[wasm_bindgen(method)]
|
#[wasm_bindgen(method)]
|
||||||
pub fn reverse(this: &Array) -> Array;
|
pub fn reverse(this: &Array) -> Array;
|
||||||
|
|
||||||
|
/// The shift() method removes the first element from an array and returns
|
||||||
|
/// that removed element. This method changes the length of the array.
|
||||||
|
///
|
||||||
|
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
|
||||||
|
#[wasm_bindgen(method)]
|
||||||
|
pub fn shift(this: &Array) -> JsValue;
|
||||||
|
|
||||||
/// The slice() method returns a shallow copy of a portion of an array into
|
/// 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).
|
/// a new array object selected from begin to end (end not included).
|
||||||
/// The original array will not be modified.
|
/// The original array will not be modified.
|
||||||
@ -184,13 +191,6 @@ extern {
|
|||||||
#[wasm_bindgen(method)]
|
#[wasm_bindgen(method)]
|
||||||
pub fn slice(this: &Array, start: u32, end: u32) -> Array;
|
pub fn slice(this: &Array, start: u32, end: u32) -> Array;
|
||||||
|
|
||||||
/// The shift() method removes the first element from an array and returns
|
|
||||||
/// that removed element. This method changes the length of the array.
|
|
||||||
///
|
|
||||||
/// http://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/shift
|
|
||||||
#[wasm_bindgen(method)]
|
|
||||||
pub fn shift(this: &Array) -> JsValue;
|
|
||||||
|
|
||||||
/// The sort() method sorts the elements of an array in place and returns
|
/// The sort() method sorts the elements of an array in place and returns
|
||||||
/// the array. The sort is not necessarily stable. The default sort
|
/// the array. The sort is not necessarily stable. The default sort
|
||||||
/// order is according to string Unicode code points.
|
/// order is according to string Unicode code points.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user