--- parser3/src/classes/reflection.C 2016/12/01 23:42:35 1.73 +++ parser3/src/classes/reflection.C 2016/12/05 23:52:49 1.76 @@ -10,7 +10,7 @@ #include "pa_vbool.h" #include "pa_vobject.h" -volatile const char * IDENT_REFLECTION_C="$Id: reflection.C,v 1.73 2016/12/01 23:42:35 moko Exp $"; +volatile const char * IDENT_REFLECTION_C="$Id: reflection.C,v 1.76 2016/12/05 23:52:49 moko Exp $"; static const String class_type_methoded("methoded"); @@ -51,7 +51,7 @@ static void _create(Request& r, MethodPa const String* class_name=0; const String* constructor_name=0; - Value& voptions=params.as_no_junction(0, "params must not be code"); + Value& voptions=params.as_no_junction(0, "param must not be code"); if(HashStringValue* options=voptions.get_hash()) { int valid_options=0; if(Value* vclass_name=options->get("class")) { @@ -78,7 +78,7 @@ static void _create(Request& r, MethodPa params_offset=1; } else { - class_name=¶ms.as_string(0, "param must be string or hash"); + class_name=¶ms.as_string(0, "param must not be code"); if(params.count()==1) throw Exception(PARSER_RUNTIME, 0, "constructor name must be specified"); @@ -102,17 +102,18 @@ static void _create(Request& r, MethodPa if(nparams>MAX_CREATE_PARAMS) throw Exception(PARSER_RUNTIME, 0, "arguments count should not exceed %d", MAX_CREATE_PARAMS); + Value* args[MAX_CREATE_PARAMS]; CONSTRUCTOR_FRAME_ACTION(*method, r.get_method_frame(), object, { - Value* v[MAX_CREATE_PARAMS]; if(nparams>0){ if(params_hash){ - for(HashStringValue::Iterator i(*params_hash); i; i.next() ) - v[i]=i.value(); + int i=0; + for(HashStringValue::Iterator h(*params_hash); h; h.next()) + args[i++]=h.value(); } else { for(int i=0; i