diff options
author | Matt McCoy <mattnenterprise@yahoo.com> | 2014-12-24 17:16:48 -0500 |
---|---|---|
committer | Matt McCoy <mattnenterprise@yahoo.com> | 2014-12-24 17:16:48 -0500 |
commit | bdb75c2146f3519a9526d589d25ae7c2499fcc56 (patch) | |
tree | c94028e78f0cf2dd5187b1effe725024a417dc70 /components/script | |
parent | 070008b4c43337b3ef4ef78b09f73e64b4d0be23 (diff) | |
download | servo-bdb75c2146f3519a9526d589d25ae7c2499fcc56.tar.gz servo-bdb75c2146f3519a9526d589d25ae7c2499fcc56.zip |
This fixes #4166. throw_dom_exception will take the GlobalRef by value, and all generated code will pass it by value.
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 2 | ||||
-rw-r--r-- | components/script/dom/bindings/error.rs | 4 |
2 files changed, 3 insertions, 3 deletions
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<T> = Result<T, Error>; 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); |