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