aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r--components/script/dom/bindings/error.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs
index 1c0d49c4976..96ae220ce98 100644
--- a/components/script/dom/bindings/error.rs
+++ b/components/script/dom/bindings/error.rs
@@ -8,9 +8,9 @@ use dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
use dom::bindings::codegen::PrototypeList::proto_id_to_name;
use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, ToJSValConvertible};
use dom::bindings::conversions::root_from_object;
-use dom::bindings::global::{GlobalRef, global_root_from_context};
use dom::bindings::str::USVString;
use dom::domexception::{DOMErrorName, DOMException};
+use dom::globalscope::GlobalScope;
use js::error::{throw_range_error, throw_type_error};
use js::jsapi::HandleObject;
use js::jsapi::JSContext;
@@ -87,7 +87,7 @@ pub type Fallible<T> = Result<T, Error>;
pub type ErrorResult = Fallible<()>;
/// Set a pending exception for the given `result` on `cx`.
-pub unsafe fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, result: Error) {
+pub unsafe fn throw_dom_exception(cx: *mut JSContext, global: &GlobalScope, result: Error) {
let code = match result {
Error::IndexSize => DOMErrorName::IndexSizeError,
Error::NotFound => DOMErrorName::NotFoundError,
@@ -245,8 +245,8 @@ pub unsafe fn report_pending_exception(cx: *mut JSContext, dispatch_event: bool)
error_info.message);
if dispatch_event {
- let global = global_root_from_context(cx);
- global.r().report_an_error(error_info, value.handle());
+ GlobalScope::from_context(cx)
+ .report_an_error(error_info, value.handle());
}
}
}
@@ -270,7 +270,7 @@ pub unsafe fn throw_invalid_this(cx: *mut JSContext, proto_id: u16) {
impl Error {
/// Convert this error value to a JS value, consuming it in the process.
- pub unsafe fn to_jsval(self, cx: *mut JSContext, global: GlobalRef, rval: MutableHandleValue) {
+ pub unsafe fn to_jsval(self, cx: *mut JSContext, global: &GlobalScope, rval: MutableHandleValue) {
assert!(!JS_IsExceptionPending(cx));
throw_dom_exception(cx, global, self);
assert!(JS_IsExceptionPending(cx));