mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
js-sys: add bindings for regexp.lastIndex
This commit is contained in:
@ -56,6 +56,15 @@ fn input() {
|
||||
assert_eq!(RegExp::input(), "hi there!");
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn last_index() {
|
||||
let re = RegExp::new("hi", "g");
|
||||
assert_eq!(re.last_index(), 0);
|
||||
|
||||
re.set_last_index(42);
|
||||
assert_eq!(re.last_index(), 42);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn last_match() {
|
||||
let re = RegExp::new("hi", "g");
|
||||
|
Reference in New Issue
Block a user