Propagate JSFailed error & conditionally execute initial assertion when converting error to JS value.

This commit is contained in:
Julien Tregoat 2019-06-28 00:34:56 -04:00
parent fb7aa7ba7c
commit 28fcde9e10
4 changed files with 13 additions and 10 deletions

View file

@ -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));