mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Switch to using the new rooted!/RootedGuard API for rooting.
This commit is contained in:
parent
a77cc9950f
commit
0db1faf876
28 changed files with 238 additions and 237 deletions
|
@ -10,7 +10,7 @@ use dom::bindings::global::GlobalRef;
|
|||
use dom::domexception::{DOMErrorName, DOMException};
|
||||
use js::error::{throw_range_error, throw_type_error};
|
||||
use js::jsapi::JSAutoCompartment;
|
||||
use js::jsapi::{JSContext, JSObject, RootedValue};
|
||||
use js::jsapi::{JSContext, JSObject};
|
||||
use js::jsapi::{JS_IsExceptionPending, JS_ReportPendingException, JS_SetPendingException};
|
||||
use js::jsval::UndefinedValue;
|
||||
|
||||
|
@ -115,7 +115,7 @@ pub unsafe fn throw_dom_exception(cx: *mut JSContext, global: GlobalRef, result:
|
|||
|
||||
assert!(!JS_IsExceptionPending(cx));
|
||||
let exception = DOMException::new(global, code);
|
||||
let mut thrown = RootedValue::new(cx, UndefinedValue());
|
||||
rooted!(in(cx) let mut thrown = UndefinedValue());
|
||||
exception.to_jsval(cx, thrown.handle_mut());
|
||||
JS_SetPendingException(cx, thrown.handle());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue