mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-17 06:21:36 +03:00
bec3178e3c
Part of #670
18 lines
491 B
Rust
18 lines
491 B
Rust
use wasm_bindgen::JsValue;
|
|
use wasm_bindgen_test::*;
|
|
use wasm_bindgen::JsCast;
|
|
use js_sys::*;
|
|
|
|
#[wasm_bindgen_test]
|
|
fn syntax_error() {
|
|
let error = SyntaxError::new("msg");
|
|
assert!(error.is_instance_of::<SyntaxError>());
|
|
assert!(error.is_instance_of::<Error>());
|
|
assert!(error.is_instance_of::<Object>());
|
|
let _: &Error = error.as_ref();
|
|
let _: &Object = error.as_ref();
|
|
|
|
let base: &Error = error.as_ref();
|
|
assert_eq!(JsValue::from(base.message()), "msg");
|
|
}
|