mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-27 03:55:20 +03:00
parent
687412ec50
commit
bec3178e3c
@ -2092,7 +2092,7 @@ extern {
|
||||
/// or range of allowed values.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError
|
||||
#[wasm_bindgen(extends = Error)]
|
||||
#[wasm_bindgen(extends = Error, extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type RangeError;
|
||||
|
||||
@ -2111,7 +2111,7 @@ extern {
|
||||
/// variable is referenced.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError
|
||||
#[wasm_bindgen(extends = Error)]
|
||||
#[wasm_bindgen(extends = Error, extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type ReferenceError;
|
||||
|
||||
@ -2505,7 +2505,7 @@ extern {
|
||||
/// parsing code.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError
|
||||
#[wasm_bindgen(extends = Error)]
|
||||
#[wasm_bindgen(extends = Error, extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type SyntaxError;
|
||||
|
||||
@ -2525,7 +2525,7 @@ extern {
|
||||
/// expected type.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError
|
||||
#[wasm_bindgen(extends = Error)]
|
||||
#[wasm_bindgen(extends = Error, extends = Object)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type TypeError;
|
||||
|
||||
@ -2758,7 +2758,7 @@ extern {
|
||||
/// function was used in a wrong way.
|
||||
///
|
||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError
|
||||
#[wasm_bindgen(extends = Error, js_name = URIError)]
|
||||
#[wasm_bindgen(extends = Error, extends = Object, js_name = URIError)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub type UriError;
|
||||
|
||||
|
@ -9,6 +9,8 @@ fn range_error() {
|
||||
assert!(error.is_instance_of::<RangeError>());
|
||||
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()), "out of range yo");
|
||||
|
@ -9,6 +9,8 @@ fn reference_error() {
|
||||
assert!(error.is_instance_of::<ReferenceError>());
|
||||
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()), "bad reference, fool");
|
||||
|
@ -9,6 +9,8 @@ fn syntax_error() {
|
||||
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");
|
||||
|
@ -9,6 +9,8 @@ fn type_error() {
|
||||
assert!(error.is_instance_of::<TypeError>());
|
||||
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");
|
||||
|
@ -9,6 +9,8 @@ fn uri_error() {
|
||||
assert!(error.is_instance_of::<UriError>());
|
||||
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");
|
||||
|
Loading…
Reference in New Issue
Block a user