mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make report_pending_exception unsafe
This commit is contained in:
parent
bc52617d33
commit
27620320f3
3 changed files with 12 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue