mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-05-12 05:47:15 +00:00
Merge pull request #671 from fitzgen/regexp-extends-attributes
js-sys: Add extends attributes for js_sys::RegExp
This commit is contained in:
commit
16dbed59b2
@ -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