mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-25 18:51:35 +00:00
Add basic support for String.prototype.charAt() (#306)
* String - charAt() implementation * String - charAt() - add js_class
This commit is contained in:
committed by
Nick Fitzgerald
parent
245f0f0eea
commit
d28d81f38d
@ -347,6 +347,13 @@ extern {
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
|
||||
#[wasm_bindgen(method, js_class = "String")]
|
||||
pub fn slice(this: &JsString, start: u32, end: u32) -> JsString;
|
||||
|
||||
/// The String object's charAt() method returns a new string consisting of the single
|
||||
/// UTF-16 code unit located at the specified offset into the string.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt
|
||||
#[wasm_bindgen(method, js_class = "String", js_name = charAt)]
|
||||
pub fn char_at(this: &JsString, index: u32) -> JsString;
|
||||
}
|
||||
|
||||
impl<'a> From<&'a str> for JsString {
|
||||
|
Reference in New Issue
Block a user