mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-23 09:41:33 +00:00
js-sys: Add bindings to RangeError
This commit is contained in:
14
crates/js-sys/tests/wasm/RangeError.rs
Normal file
14
crates/js-sys/tests/wasm/RangeError.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 range_error() {
|
||||
let error = RangeError::new("out of range yo");
|
||||
assert!(error.is_instance_of::<RangeError>());
|
||||
assert!(error.is_instance_of::<Error>());
|
||||
|
||||
let base: &Error = error.as_ref();
|
||||
assert_eq!(JsValue::from(base.message()), "out of range yo");
|
||||
}
|
@ -25,6 +25,7 @@ pub mod Math;
|
||||
pub mod Number;
|
||||
pub mod Object;
|
||||
pub mod Proxy;
|
||||
pub mod RangeError;
|
||||
pub mod Reflect;
|
||||
pub mod RegExp;
|
||||
pub mod Set;
|
||||
|
Reference in New Issue
Block a user