mirror of https://github.com/axmolengine/axmol.git
[JSB] long —> ssize_t in JSB_TableViewDataSource::callJSDelegate.
This commit is contained in:
parent
a515c7eb1c
commit
325f2e21a7
|
@ -350,7 +350,7 @@ private:
|
||||||
return false;
|
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);
|
js_proxy_t * p = jsb_get_native_proxy(table);
|
||||||
if (!p) return false;
|
if (!p) return false;
|
||||||
|
@ -360,7 +360,7 @@ private:
|
||||||
JS::RootedValue temp_retval(cx);
|
JS::RootedValue temp_retval(cx);
|
||||||
jsval dataVal[2];
|
jsval dataVal[2];
|
||||||
dataVal[0] = OBJECT_TO_JSVAL(p->obj);
|
dataVal[0] = OBJECT_TO_JSVAL(p->obj);
|
||||||
dataVal[1] = long_to_jsval(cx,idx);
|
dataVal[1] = ssize_to_jsval(cx,idx);
|
||||||
|
|
||||||
JSObject* obj = _JSTableViewDataSource;
|
JSObject* obj = _JSTableViewDataSource;
|
||||||
JSAutoCompartment ac(cx, obj);
|
JSAutoCompartment ac(cx, obj);
|
||||||
|
@ -377,9 +377,9 @@ private:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),
|
JSBool ret = JS_CallFunctionName(cx, obj, jsFunctionName.c_str(),
|
||||||
2, dataVal, &retVal);
|
2, dataVal, &retVal);
|
||||||
return true;
|
return ret == JS_TRUE ? true : false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue