diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 01efdd012c0..df7085e64d2 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -2215,7 +2215,7 @@ class CGCallGenerator(CGThing): " Ok(result) => result,\n" " Err(e) => {\n" "%s" - " throw_dom_exception(cx, &global.root_ref(), e);\n" + " throw_dom_exception(cx, global.root_ref(), e);\n" " return%s;\n" " },\n" "};\n" % (glob, errorResult))) diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs index 4cfdd3a0663..f9de48935dc 100644 --- a/components/script/dom/bindings/error.rs +++ b/components/script/dom/bindings/error.rs @@ -46,10 +46,10 @@ pub type Fallible = Result; pub type ErrorResult = Fallible<()>; /// Set a pending DOM exception for the given `result` on `cx`. -pub fn throw_dom_exception(cx: *mut JSContext, global: &GlobalRef, +pub fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, result: Error) { assert!(unsafe { JS_IsExceptionPending(cx) } == 0); - let exception = DOMException::new_from_error(*global, result).root(); + let exception = DOMException::new_from_error(global, result).root(); let thrown = exception.to_jsval(cx); unsafe { JS_SetPendingException(cx, thrown);