mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
js-sys: Add bindings to URIError
This commit is contained in:
14
crates/js-sys/tests/wasm/UriError.rs
Normal file
14
crates/js-sys/tests/wasm/UriError.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use wasm_bindgen::JsValue;
|
||||
use wasm_bindgen_test::*;
|
||||
use wasm_bindgen::JsCast;
|
||||
use js_sys::*;
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn uri_error() {
|
||||
let error = UriError::new("msg");
|
||||
assert!(error.is_instance_of::<UriError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "msg");
|
||||
}
|
@ -33,6 +33,7 @@ pub mod Set;
|
||||
pub mod SetIterator;
|
||||
pub mod Symbol;
|
||||
pub mod TypedArray;
|
||||
pub mod UriError;
|
||||
pub mod WeakMap;
|
||||
pub mod WeakSet;
|
||||
pub mod WebAssembly;
|
||||
|
Reference in New Issue
Block a user