From 325f2e21a76413a47e2e114fca66d4ced04a651b Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 24 Dec 2013 10:41:45 +0800 Subject: [PATCH] =?UTF-8?q?[JSB]=20long=20=E2=80=94>=20ssize=5Ft=20in=20JS?= =?UTF-8?q?B=5FTableViewDataSource::callJSDelegate.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bindings/extension/jsb_cocos2dx_extension_manual.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp b/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp index beea364b4b..6d27aa81a7 100644 --- a/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/javascript/bindings/extension/jsb_cocos2dx_extension_manual.cpp @@ -350,7 +350,7 @@ private: return false; } - bool callJSDelegate(TableView* table, long idx, std::string jsFunctionName, jsval& retVal) + bool callJSDelegate(TableView* table, ssize_t idx, std::string jsFunctionName, jsval& retVal) { js_proxy_t * p = jsb_get_native_proxy(table); if (!p) return false; @@ -360,7 +360,7 @@ private: JS::RootedValue temp_retval(cx); jsval dataVal[2]; dataVal[0] = OBJECT_TO_JSVAL(p->obj); - dataVal[1] = long_to_jsval(cx,idx); + dataVal[1] = ssize_to_jsval(cx,idx); JSObject* obj = _JSTableViewDataSource; JSAutoCompartment ac(cx, obj); @@ -377,9 +377,9 @@ private: return false; } - JS_CallFunctionName(cx, obj, jsFunctionName.c_str(), + JSBool ret = JS_CallFunctionName(cx, obj, jsFunctionName.c_str(), 2, dataVal, &retVal); - return true; + return ret == JS_TRUE ? true : false; } return false; }