Use safe JSContext as first argument for throw_dom_exception

This commit is contained in:
marmeladema 2019-07-27 19:36:21 +01:00
parent 6c26518f61
commit 0703a1ad6d
6 changed files with 29 additions and 25 deletions

View file

@ -18,6 +18,7 @@ use crate::dom::document::Document;
use crate::dom::element::Element;
use crate::dom::globalscope::GlobalScope;
use crate::dom::window::Window;
use crate::script_runtime::JSContext as SafeJSContext;
use crate::script_thread::ScriptThread;
use dom_struct::dom_struct;
use embedder_traits::EmbedderMsg;
@ -959,7 +960,7 @@ pub fn new_window_proxy_handler() -> WindowProxyHandler {
unsafe fn throw_security_error(cx: *mut JSContext) -> bool {
if !JS_IsExceptionPending(cx) {
let global = GlobalScope::from_context(cx);
throw_dom_exception(cx, &*global, Error::Security);
throw_dom_exception(SafeJSContext::from_ptr(cx), &*global, Error::Security);
}
false
}