mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Propagate JSFailed error & conditionally execute initial assertion when converting error to JS value.
This commit is contained in:
parent
fb7aa7ba7c
commit
28fcde9e10
4 changed files with 13 additions and 10 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue