@footprint 写道:
在参数隐形转化上,如果遇到\0的字符,会导致被数据被截取
/**
* @brief get (raw) responseText
*
*/
JS_BINDED_PROP_GET_IMPL(MinXmlHttpRequest, responseText)
{
if (_data)
{
std::string correct = std::string(_data, _dataSize);
//jsval strVal = std_string_to_jsval(cx, _data); //bug!
jsval strVal = std_string_to_jsval(cx, correct);if (strVal != JSVAL_NULL) { args.rval().set(strVal); return true; } } CCLOGERROR("ResponseText was empty, probably there is a network error!"); // Return an empty string args.rval().set(std_string_to_jsval(cx, "")); return true;
}
帖子: 1
参与者: 1