MCPcopy Create free account
hub / github.com/9miao/CrossApp / executeFunctionWithOwner

Method executeFunctionWithOwner

scripting/javascript/bindings/ScriptingCore.cpp:879–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879JSBool ScriptingCore::executeFunctionWithOwner(jsval owner, const char *name, uint32_t argc /* = 0 */, jsval *vp /* = NULL */, jsval* retVal /* = NULL */)
880{
881 JSBool bRet = JS_FALSE;
882 JSBool hasAction;
883 jsval temp_retval;
884 JSContext* cx = this->cx_;
885 JSObject* obj = JSVAL_TO_OBJECT(owner);
886
887 do
888 {
889 if (JS_HasProperty(cx, obj, name, &hasAction) && hasAction) {
890 if(!JS_GetProperty(cx, obj, name, &temp_retval)) {
891 break;
892 }
893 if(temp_retval == JSVAL_VOID) {
894 break;
895 }
896
897 JSAutoCompartment ac(cx, obj);
898 if (retVal)
899 {
900 bRet = JS_CallFunctionName(cx, obj, name, argc, vp, retVal);
901
902 }
903 else {
904 jsval jsret;
905 bRet = JS_CallFunctionName(cx, obj, name, argc, vp, &jsret);
906 }
907 }
908 }while(0);
909 return bRet;
910}
911
912int ScriptingCore::executeAccelerometerEvent(CAView *pLayer, CCAcceleration *pAccelerationValue) {
913

Callers 15

onOpenMethod · 0.80
onMessageMethod · 0.80
onCloseMethod · 0.80
onErrorMethod · 0.80
scrollViewDidScrollMethod · 0.80
scrollViewDidZoomMethod · 0.80
onTextFieldInsertTextMethod · 0.80
getKeyBoardHeightMethod · 0.80
didSelectRowMethod · 0.80

Calls 1

JSVAL_TO_OBJECTFunction · 0.50

Tested by 15

scrollViewDidScrollMethod · 0.64
scrollViewDidZoomMethod · 0.64
onTextFieldInsertTextMethod · 0.64
getKeyBoardHeightMethod · 0.64
didSelectRowMethod · 0.64
pageViewDidEndTurningMethod · 0.64
callJSDelegateMethod · 0.64