Add binding for String.prototype.localeCompare

This commit is contained in:
Danielle Pham
2018-08-18 20:51:52 -04:00
parent 7a08da9205
commit 0d3f706195
2 changed files with 72 additions and 0 deletions

View File

@ -2996,6 +2996,14 @@ extern "C" {
#[wasm_bindgen(method, js_class = "String", js_name = lastIndexOf)]
pub fn last_index_of(this: &JsString, search_value: &str, from_index: i32) -> i32;
/// The localeCompare() method returns a number indicating whether
/// a reference string comes before or after or is the same as
/// the given string in sort order.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
#[wasm_bindgen(method, js_class = "String", js_name = localeCompare)]
pub fn locale_compare(this: &JsString, compare_string: &str, locales: &Array, options: &Object) -> i32;
/// The normalize() method returns the Unicode Normalization Form
/// of a given string (if the value isn't a string, it will be converted to one first).
///