Use the JSVal member functions to replace JSVAL_IS_* and JSVAL_TO_*.

This commit is contained in:
Ms2ger 2014-03-09 11:29:23 +01:00
parent 84b0f45ed5
commit 9709dce07a
7 changed files with 32 additions and 57 deletions

View file

@ -6,7 +6,7 @@ use dom::bindings::utils::Reflectable;
use js::jsapi::{JSContext, JSObject, JS_WrapObject, JS_ObjectIsCallable};
use js::jsapi::{JS_GetProperty, JSTracer, JS_CallTracer};
use js::jsval::JSVal;
use js::{JSVAL_IS_OBJECT, JSVAL_TO_OBJECT, JSTRACE_OBJECT};
use js::JSTRACE_OBJECT;
use std::cast;
use std::libc;
@ -67,8 +67,8 @@ impl CallbackInterface {
return false;
}
if !JSVAL_IS_OBJECT(*callable) ||
JS_ObjectIsCallable(cx, JSVAL_TO_OBJECT(*callable)) == 0 {
if !callable.is_object() ||
JS_ObjectIsCallable(cx, callable.to_object()) == 0 {
//ThrowErrorMessage(cx, MSG_NOT_CALLABLE, description.get());
return false;
}