Diff for /parser3/src/classes/reflection.C between versions 1.100 and 1.103

version 1.100, 2025/10/05 19:41:27 version 1.103, 2026/04/24 20:14:33
Line 126  static void _create(Request& r, MethodPa Line 126  static void _create(Request& r, MethodPa
   
 static void _classes(Request& r, MethodParams&) {  static void _classes(Request& r, MethodParams&) {
         VHash& result=*new VHash;          VHash& result=*new VHash;
         for(HashString<VStateless_class*>::Iterator i(r.classes()); i; i.next()){          for(OrderedHashString<VStateless_class*>::Iterator i(r.classes()); i; i.next()){
                 result.hash().put(i.key(), i.value()->get_methods().count()>0 ? new VString(class_type_methoded) : VVoid::get() );                  result.hash().put(i.key(), i.value()->get_methods().count()>0 ? new VString(class_type_methoded) : VVoid::get() );
         }          }
         r.write(result);          r.write(result);
Line 536  static void _override(Request& r, Method Line 536  static void _override(Request& r, Method
         const Method* method=j ? j->method : 0;          const Method* method=j ? j->method : 0;
         if(!method)          if(!method)
                 throw Exception(PARSER_RUNTIME, 0, "param must be method junction");                  throw Exception(PARSER_RUNTIME, 0, "param must be method junction");
           if(method->native_code)
                   throw Exception(PARSER_RUNTIME, 0, "param must not be native method");
   
         const String *name=method->name;          const String *name=method->name;
         Value* vtarget=0;          Value* vtarget=0;
Line 596  static void _tainting(Request& r, Method Line 598  static void _tainting(Request& r, Method
         }          }
 }  }
   
   struct LocalsInfo { HashStringValue* args; HashStringValue* locals; };
   
   static void collect_local(const String::Body& key, Value* value, LocalsInfo* info) {
           if(!info->args->contains(key) && (key != "result"))
                   info->locals->put(key, value->get_junction() ? VVoid::get() : value);
   }
   
 static void _stack(Request& r, MethodParams& params) {  static void _stack(Request& r, MethodParams& params) {
         bool show_args=false;          bool show_args=false;
         bool show_locals=false;          bool show_locals=false;
Line 667  static void _stack(Request& r, MethodPar Line 676  static void _stack(Request& r, MethodPar
                                                 VHash& vlocals=*new VHash;                                                  VHash& vlocals=*new VHash;
                                                 HashStringValue* locals=vlocals.get_hash();                                                  HashStringValue* locals=vlocals.get_hash();
   
                                                 if(VParserMethodFrame* frame=dynamic_cast<VParserMethodFrame*>(caller))                                                  if(VParserMethodFrame* frame=dynamic_cast<VParserMethodFrame*>(caller)){
                                                         for(HashString<Value*>::Iterator h(frame->my); h; h.next()){                                                          LocalsInfo linfo = { args, locals };
                                                                 String::Body key=h.key();                                                          frame->my.for_each(collect_local, &linfo);
                                                                 Value* value=h.value();                                                  }
                                                                 if(!args->contains(key) && (key != "result")){  
                                                                         locals->put(key, value->get_junction() ? VVoid::get() : value);  
                                                                 }  
                                                         }  
   
                                                 HASH_PUT_CSTR(*current, "locals", &vlocals);                                                  HASH_PUT_CSTR(*current, "locals", &vlocals);
                                         }                                          }

Removed from v.1.100  
changed lines
  Added in v.1.103


E-mail: