The nactive function jsval_to_ccdictionary is converted in the cocos2dx dictionary. Only three types of jsval_to_ccdictionary are determined. If they are empty, the system crashes.
Find the bottom of the function.
Else if (JSVAL_IS_STRING (value )){
JSStringWrapper valueWapper (JSVAL_TO_STRING (value), cx );
Dict-> setObject (String: create (valueWapper. get (), keyWrapper. get ());
// CCLOG ("iterate object: key = % s, value = % s", keyWrapper. get (). c_str (), valueWapper. get (). c_str ());
}
Elseif (JSVAL_IS_NUMBER (value )){
Double number = 0.0;
JSBool OK = JS_ValueToNumber (cx, value, & number );
If (OK ){
Dict-> setObject (Double: create (number), keyWrapper. get ());
// CCLOG ("iterate object: key = % s, value = % lf", keyWrapper. get (). c_str (), number );
}
}
Elseif (JSVAL_IS_BOOLEAN (value )){
JSBool boolVal = JS_FALSE;
JSBool OK = JS_ValueToBoolean (cx, value, & boolVal );
If (OK ){
Dict-> setObject (Bool: create (boolVal), keyWrapper. get ());
// + CCLOG ("iterate object: key = % s, value = % d", keyWrapper. get (). c_str (), boolVal );
}
}Else if (value. isNullOrUndefined ())
{
// CCASSERT (false, "not isNull supported type"); // The value. isNullOrUndefined must be determined; otherwise, the system will crash if the inserted value is null.
Dict-> setObject (String: create (""), keyWrapper. get ());
}
Else {
CCASSERT (false, "not supported type ");
}