|
|
| version 1.95, 2024/12/07 15:14:56 | version 1.97, 2024/12/23 16:59:17 |
|---|---|
| Line 258 static void _method(Request& r, MethodPa | Line 258 static void _method(Request& r, MethodPa |
| if(Junction *j=source.get_junction()){ | if(Junction *j=source.get_junction()){ |
| if(Method* method=const_cast<Method*>(j->method)){ | if(Method* method=const_cast<Method*>(j->method)){ |
| Value& self=params.count()>1 ? params.as_no_junction(1, "self must be object, not junction") : r.get_method_frame()->caller()->self(); | Value& self=params.count()>1 ? params.as_no_junction(1, "self must be object") : r.get_method_frame()->caller()->self(); |
| r.write(method_junction(self, *method)); | r.write(method_junction(self, *method)); |
| return; | return; |
| } | } |
| Line 272 static void _method(Request& r, MethodPa | Line 272 static void _method(Request& r, MethodPa |
| if(VStateless_class* vclass=source.get_class()) { | if(VStateless_class* vclass=source.get_class()) { |
| if(Method* method=vclass->get_method(name)){ | if(Method* method=vclass->get_method(name)){ |
| r.write( params.count()>2 ? method_junction(params.as_no_junction(2, "self must be object, not junction"), *method) : *method->get_vjunction(source) ); | r.write( params.count()>2 ? method_junction(params.as_no_junction(2, "self must be object"), *method) : *method->get_vjunction(source) ); |
| return; | return; |
| } | } |
| } | } |
| Line 280 static void _method(Request& r, MethodPa | Line 280 static void _method(Request& r, MethodPa |
| } | } |
| static void _fields(Request& r, MethodParams& params) { | static void _fields(Request& r, MethodParams& params) { |
| Value& o=params.as_no_junction(0, "param must be object or class, not junction"); | Value& o=params.as_no_junction(0, "param must be object or class"); |
| if(HashStringValue* fields=o.get_fields()) | if(HashStringValue* fields=o.get_fields()) |
| r.write(*new VHash(*fields)); | r.write(*new VHash(*fields)); |
| Line 289 static void _fields(Request& r, MethodPa | Line 289 static void _fields(Request& r, MethodPa |
| } | } |
| static void _fields_reference(Request& r, MethodParams& params) { | static void _fields_reference(Request& r, MethodParams& params) { |
| Value& o=params.as_no_junction(0, "param must be object or hash, not junction"); | Value& o=params.as_no_junction(0, "param must be object or hash"); |
| if(HashStringValue* fields=o.get_fields_reference()) | if(HashStringValue* fields=o.get_fields_reference()) |
| r.write(*new VHashReference(*fields)); | r.write(*new VHashReference(*fields)); |
| Line 298 static void _fields_reference(Request& r | Line 298 static void _fields_reference(Request& r |
| } | } |
| static void _field(Request& r, MethodParams& params) { | static void _field(Request& r, MethodParams& params) { |
| Value& o=params.as_no_junction(0, "first param must be object or class, not junction"); | Value& o=params.as_no_junction(0, "first param must be object or class"); |
| const String& name=params.as_string(1, "field name must be string"); | const String& name=params.as_string(1, "field name must be string"); |
| if(HashStringValue* fields=o.get_fields()) | if(HashStringValue* fields=o.get_fields()) |
| Line 376 static void _method_info(Request& r, Met | Line 376 static void _method_info(Request& r, Met |
| VArray& named_params=*new VArray(named_count); | VArray& named_params=*new VArray(named_count); |
| ArrayValue &array=named_params.array(); | ArrayValue &array=named_params.array(); |
| for(int i=0; i<named_count; i++) { | for(size_t i=0; i<named_count; i++) { |
| const String& fname=*(*method->named_params)[i]; | const String& fname=*(*method->named_params)[i]; |
| array+=new VString(fname); | array+=new VString(fname); |
| } | } |
| Line 451 static void _uid(Request& r, MethodParam | Line 451 static void _uid(Request& r, MethodParam |
| } | } |
| static void _delete(Request&, MethodParams& params) { | static void _delete(Request&, MethodParams& params) { |
| Value* v=¶ms.as_no_junction(0, "param must be object or class, not junction"); | Value* v=¶ms.as_no_junction(0, "param must be object or class"); |
| const String& key=params.as_string(1, "field name must be string"); | const String& key=params.as_string(1, "field name must be string"); |
| if(VObject* o=dynamic_cast<VObject*>(v)){ | if(VObject* o=dynamic_cast<VObject*>(v)){ |