mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-02 09:02:16 +00:00
parent
66f10b0c72
commit
235f9cc04e
@ -2102,6 +2102,7 @@ extern "C" {
|
||||
// RegExp
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
#[wasm_bindgen(extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type RegExp;
|
||||
|
||||
|
@ -1,6 +1,14 @@
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn regexp_inheritance() {
|
||||
let re = RegExp::new(".", "");
|
||||
assert!(re.is_instance_of::<RegExp>());
|
||||
assert!(re.is_instance_of::<Object>());
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn exec() {
|
||||
let re = RegExp::new("quick\\s(brown).+?(jumps)", "ig");
|
||||
|
Loading…
x
Reference in New Issue
Block a user