本文整理汇总了C++中JSGlobalObject::deleteTimer方法的典型用法代码示例。如果您正苦于以下问题:C++ JSGlobalObject::deleteTimer方法的具体用法?C++ JSGlobalObject::deleteTimer怎么用?C++ JSGlobalObject::deleteTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSGlobalObject
的用法示例。
在下文中一共展示了JSGlobalObject::deleteTimer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromjs_deleteTimer
JSBool JSJSGlobalObject::fromjs_deleteTimer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) {
// get instance
JSGlobalObject *object = static_cast<JSGlobalObject *>(reinterpret_cast<JSScriptable *>(JS_GetPrivate(cx, obj)));
if (!object) {
JSScriptable::js_throwNullCallException(JSJSGlobalObject::classDescriptor.name, JSJSGlobalObject::functionTable[3].name);
return JS_FALSE;
}
// record context
object->js_setCurrentContext(cx);
// JSTimer *timer
JSObject *p0;
if (!JS_ValueToObject(cx, argv[0], &p0))
return JS_FALSE;
argv[0] = OBJECT_TO_JSVAL(p0);
JSTimer *p0o = NULL;
if (p0) {
JSScriptable *pobj = reinterpret_cast<JSScriptable*>(JS_GetPrivate(cx, p0));
if (!pobj) {
object->js_throwNullParamException(0, JSJSGlobalObject::functionTable[3].name, JSJSGlobalObject::classDescriptor.name);
return JS_FALSE;
}
p0o = static_cast<JSTimer *>(pobj->js_getInterface(JS_JSTimer_GUID));
if (!p0o) {
object->js_throwParamTypeException(0, JSJSTimer::classDescriptor.name, JSJSGlobalObject::functionTable[3].name, JSJSGlobalObject::classDescriptor.name);
return JS_FALSE;
}
}
// call method
ASSERT(object != NULL);
object->deleteTimer(p0o);
// success
return JS_TRUE;
}