Switch to using the new rooted!/RootedGuard API for rooting.

This commit is contained in:
Eduard Burtescu 2016-07-04 20:59:01 +03:00
parent a77cc9950f
commit 0db1faf876
28 changed files with 238 additions and 237 deletions

View file

@ -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());
}