Add binding for String.prototype.match

This commit is contained in:
Danielle Pham
2018-08-18 21:55:59 -04:00
parent 12a6aaa1bf
commit 7b53b1c88e
2 changed files with 31 additions and 2 deletions

View File

@ -2974,7 +2974,6 @@ extern "C" {
#[wasm_bindgen(static_method_of = JsString, js_class = "String", js_name = fromCharCode)]
pub fn from_char_code5(a: u32, b: u32, c: u32, d: u32, e: u32) -> JsString;
/// The static String.fromCodePoint() method returns a string created by
/// using the specified sequence of code points.
///
@ -3007,7 +3006,6 @@ extern "C" {
#[wasm_bindgen(catch, static_method_of = JsString, js_class = "String", js_name = fromCodePoint)]
pub fn from_code_point5(a: u32, b: u32, c: u32, d: u32, e: u32) -> Result<JsString, JsValue>;
/// The `includes()` method determines whether one string may be found
/// within another string, returning true or false as appropriate.
///
@ -3039,6 +3037,12 @@ extern "C" {
#[wasm_bindgen(method, js_class = "String", js_name = localeCompare)]
pub fn locale_compare(this: &JsString, compare_string: &str, locales: &Array, options: &Object) -> i32;
/// The match() method retrieves the matches when matching a string against a regular expression.
///
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match
#[wasm_bindgen(method, js_class = "String", js_name = match)]
pub fn match_(this: &JsString, pattern: &RegExp) -> Option<Object>;
/// 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).
///