aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/error.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2016-06-07 00:26:49 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2016-06-07 00:26:49 +0200
commit27620320f364d5345de3631ec605d1c3b376208f (patch)
tree0dc86a6274658efea308280298dbaaf3a5e97000 /components/script/dom/bindings/error.rs
parentbc52617d3351d64cfd1479c5088b591370529f59 (diff)
downloadservo-27620320f364d5345de3631ec605d1c3b376208f.tar.gz
servo-27620320f364d5345de3631ec605d1c3b376208f.zip
Make report_pending_exception unsafe
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r--components/script/dom/bindings/error.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs
index a9ee93663e7..ed0b81c4d64 100644
--- a/components/script/dom/bindings/error.rs
+++ b/components/script/dom/bindings/error.rs
@@ -121,12 +121,10 @@ pub unsafe fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, result:
}
/// Report a pending exception, thereby clearing it.
-pub fn report_pending_exception(cx: *mut JSContext, obj: *mut JSObject) {
- unsafe {
- if JS_IsExceptionPending(cx) {
- let _ac = JSAutoCompartment::new(cx, obj);
- JS_ReportPendingException(cx);
- }
+pub unsafe fn report_pending_exception(cx: *mut JSContext, obj: *mut JSObject) {
+ if JS_IsExceptionPending(cx) {
+ let _ac = JSAutoCompartment::new(cx, obj);
+ JS_ReportPendingException(cx);
}
}