diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-07 07:07:03 -0500 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-07 07:07:03 -0500 |
commit | 6be0494287455c5c30ef6f898b511b4348efbeef (patch) | |
tree | 0b3b905942a715bf63814337c17e5d178adbc587 /components/script/dom/bindings/error.rs | |
parent | b64b21ace0e9b3639906c9dc988c66ea596f3d88 (diff) | |
parent | 27620320f364d5345de3631ec605d1c3b376208f (diff) | |
download | servo-6be0494287455c5c30ef6f898b511b4348efbeef.tar.gz servo-6be0494287455c5c30ef6f898b511b4348efbeef.zip |
Auto merge of #11654 - nox:error, r=Ms2ger
Make report_pending_exception unsafe
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11654)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/bindings/error.rs')
-rw-r--r-- | components/script/dom/bindings/error.rs | 10 |
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); } } |