We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66f10b0 commit 235f9ccCopy full SHA for 235f9cc
crates/js-sys/src/lib.rs
@@ -2102,6 +2102,7 @@ extern "C" {
2102
// RegExp
2103
#[wasm_bindgen]
2104
extern {
2105
+ #[wasm_bindgen(extends = Object)]
2106
#[derive(Clone, Debug)]
2107
pub type RegExp;
2108
crates/js-sys/tests/wasm/RegExp.rs
@@ -1,6 +1,14 @@
1
use wasm_bindgen_test::*;
2
+use wasm_bindgen::JsCast;
3
use js_sys::*;
4
5
+#[wasm_bindgen_test]
6
+fn regexp_inheritance() {
7
+ let re = RegExp::new(".", "");
8
+ assert!(re.is_instance_of::<RegExp>());
9
+ assert!(re.is_instance_of::<Object>());
10
+}
11
+
12
#[wasm_bindgen_test]
13
fn exec() {
14
let re = RegExp::new("quick\\s(brown).+?(jumps)", "ig");
0 commit comments