aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/callback.rs
diff options
context:
space:
mode:
authorMichael Wu <mwu@mozilla.com>2015-09-23 16:53:03 -0400
committerMichael Wu <mwu@mozilla.com>2015-10-14 15:30:52 -0400
commite733a7c46a5d14a1be219e76136cdcb2d678d33a (patch)
tree7a50317a6cfa109eb3a7049add9ad87597dac55e /components/script/dom/bindings/callback.rs
parent32daa17d5cbcad02db0713e21e52410cdc60480e (diff)
downloadservo-e733a7c46a5d14a1be219e76136cdcb2d678d33a.tar.gz
servo-e733a7c46a5d14a1be219e76136cdcb2d678d33a.zip
Support the updated spidermonkey bindings
Diffstat (limited to 'components/script/dom/bindings/callback.rs')
-rw-r--r--components/script/dom/bindings/callback.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/bindings/callback.rs b/components/script/dom/bindings/callback.rs
index 88fafd1188a..a879e469e27 100644
--- a/components/script/dom/bindings/callback.rs
+++ b/components/script/dom/bindings/callback.rs
@@ -122,13 +122,13 @@ impl CallbackInterface {
let obj = RootedObject::new(cx, self.callback());
unsafe {
let c_name = CString::new(name).unwrap();
- if JS_GetProperty(cx, obj.handle(), c_name.as_ptr(),
- callable.handle_mut()) == 0 {
+ if !JS_GetProperty(cx, obj.handle(), c_name.as_ptr(),
+ callable.handle_mut()) {
return Err(Error::JSFailed);
}
if !callable.ptr.is_object() ||
- IsCallable(callable.ptr.to_object()) == 0 {
+ !IsCallable(callable.ptr.to_object()) {
return Err(Error::Type(
format!("The value of the {} property is not callable", name)));
}
@@ -145,7 +145,7 @@ pub fn wrap_call_this_object<T: Reflectable>(cx: *mut JSContext,
assert!(!rval.get().is_null());
unsafe {
- if JS_WrapObject(cx, rval) == 0 {
+ if !JS_WrapObject(cx, rval) {
rval.set(ptr::null_mut());
}
}
@@ -198,11 +198,11 @@ impl Drop for CallSetup {
unsafe { JS_LeaveCompartment(self.cx, self.old_compartment); }
let need_to_deal_with_exception =
self.handling == ExceptionHandling::Report &&
- unsafe { JS_IsExceptionPending(self.cx) } != 0;
+ unsafe { JS_IsExceptionPending(self.cx) };
if need_to_deal_with_exception {
unsafe {
let old_global = RootedObject::new(self.cx, self.exception_compartment.ptr);
- let saved = JS_SaveFrameChain(self.cx) != 0;
+ let saved = JS_SaveFrameChain(self.cx);
{
let _ac = JSAutoCompartment::new(self.cx, old_global.ptr);
JS_ReportPendingException(self.cx);