|
|
| version 1.67, 2016/11/26 22:54:17 | version 1.69, 2016/11/29 23:25:59 |
|---|---|
| Line 62 static void _create(Request& r, MethodPa | Line 62 static void _create(Request& r, MethodPa |
| int max_params_count; | int max_params_count; |
| if(method->native_code){ | if(method->native_code){ |
| if(method->call_type==Method::CT_STATIC) | |
| throw Exception(PARSER_RUNTIME, | |
| &constructor_name, | |
| "native method of class '%s' is not allowed to be called dynamically", | |
| vclass->type()); | |
| if(nparams<method->min_numbered_params_count) | if(nparams<method->min_numbered_params_count) |
| throw Exception(PARSER_RUNTIME, | throw Exception(PARSER_RUNTIME, |
| &constructor_name, | &constructor_name, |
| Line 311 static void _method_info(Request& r, Met | Line 305 static void _method_info(Request& r, Met |
| hash->put(method_max_params, new VInt(method->max_numbered_params_count)); | hash->put(method_max_params, new VInt(method->max_numbered_params_count)); |
| } else { | } else { |
| // parser code | // parser code |
| const String* filespec = r.get_method_filename(method); | const String* filespec = r.get_method_filespec(method); |
| if( filespec ) | if( filespec ) |
| hash->put("file", new VString(*filespec)); | hash->put("file", new VString(*filespec)); |
| Line 329 static void _method_info(Request& r, Met | Line 323 static void _method_info(Request& r, Met |
| } | } |
| static void _filename(Request& r, MethodParams& params) { | static void _filename(Request& r, MethodParams& params) { |
| Value& o=params.as_no_junction(0, "param must be object or class, not junction"); | if(Junction *j=params[0].get_junction()){ |
| if(const Method* method=j->method){ | |
| if(!method->native_code) | |
| if(const String* filespec = r.get_method_filespec(method)) | |
| r.write(*new VString(*filespec)); | |
| return; | |
| } | |
| throw Exception(PARSER_RUNTIME, 0, "param must be object, class or method junction"); | |
| } | |
| if(VClass* vclass = dynamic_cast<VClass*>(o.get_class())){ | if(VClass* vclass = dynamic_cast<VClass*>(params[0].get_class())){ |
| r.write(*new VString(vclass->get_filename())); | r.write(*new VString(vclass->get_filespec())); |
| } | } |
| } | } |