diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/script/dom/bindings/error.rs | 5 | ||||
-rw-r--r-- | components/script/dom/permissions.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index da460ad94b6..5953a013d6d 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -303,7 +303,10 @@ impl Error { global: &GlobalScope, rval: MutableHandleValue, ) { - assert!(!JS_IsExceptionPending(cx)); + match self { + Error::JSFailed => (), + _ => assert!(!JS_IsExceptionPending(cx)), + } throw_dom_exception(cx, global, self); assert!(JS_IsExceptionPending(cx)); assert!(JS_GetPendingException(cx, rval)); diff --git a/components/script/dom/permissions.rs b/components/script/dom/permissions.rs index 87dc88636da..5c6d7b0aed0 100644 --- a/components/script/dom/permissions.rs +++ b/components/script/dom/permissions.rs @@ -31,8 +31,6 @@ const DIALOG_TITLE: &'static str = "Permission request dialog"; const NONSECURE_DIALOG_MESSAGE: &'static str = "feature is only safe to use in secure context,\ but servo can't guarantee\n that the current context is secure. Do you want to proceed and grant permission?"; const REQUEST_DIALOG_MESSAGE: &'static str = "Do you want to grant permission for"; -const ROOT_DESC_CONVERSION_ERROR: &'static str = - "Can't convert to an IDL value of type PermissionDescriptor"; pub trait PermissionAlgorithm { type Descriptor; @@ -237,7 +235,7 @@ impl PermissionAlgorithm for Permissions { match PermissionDescriptor::new(cx, property.handle()) { Ok(ConversionResult::Success(descriptor)) => Ok(descriptor), Ok(ConversionResult::Failure(error)) => Err(Error::Type(error.into_owned())), - Err(_) => Err(Error::Type(String::from(ROOT_DESC_CONVERSION_ERROR))), + Err(_) => Err(Error::JSFailed), } } } |