--- parser3/src/classes/json.C 2024/09/10 19:09:56 1.59 +++ parser3/src/classes/json.C 2024/09/13 04:01:22 1.61 @@ -10,7 +10,7 @@ #include "pa_request.h" #include "pa_vbool.h" -//#include "pa_varray.h" +#include "pa_varray.h" #include "pa_charset.h" #include "pa_charsets.h" @@ -20,7 +20,7 @@ #include "pa_vxdoc.h" #endif -volatile const char * IDENT_JSON_C="$Id: json.C,v 1.59 2024/09/10 19:09:56 moko Exp $"; +volatile const char * IDENT_JSON_C="$Id: json.C,v 1.61 2024/09/13 04:01:22 moko Exp $"; // class @@ -153,8 +153,7 @@ static int json_callback(Json *json, int json->key=NULL; json->stack.push(new VHash); } else { - VHashBase *v = new VHash; -// VHashBase *v = json->handle_array ? (VHashBase *)new VArray : (VHashBase *)new VHash; + VHashBase *v = json->handle_array ? (VHashBase *)new VArray : (VHashBase *)new VHash; if (json->stack.count()) set_json_value(json, v); json->stack.push(v); } @@ -651,7 +650,7 @@ static void _string(Request& r, MethodPa throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); // special handling for $._default - if(VHashBase* vhash=static_cast(params[1].as(VHASH_TYPE))) + if(VHashBase* vhash=dynamic_cast(¶ms[1])) if(Value* value=vhash->get_default()) { if(!value->is_string()){ Junction* junction=value->get_junction();