|
|
| version 1.35, 2015/10/25 22:24:05 | version 1.37, 2015/10/26 01:03:42 |
|---|---|
| Line 336 static void _dynamical(Request& r, Metho | Line 336 static void _dynamical(Request& r, Metho |
| static void _is(Request& r, MethodParams& params) { | static void _is(Request& r, MethodParams& params) { |
| const String& type=params.as_string(0, "class name must be string"); | const String& type=params.as_string(0, "class name must be string"); |
| const String& name=params.as_string(params.count()-1, "element name must be string"); | const String& name=params.as_string(params.count()-1, "element name must be string"); |
| Value &context=params.count()==3 ? params.as_no_junction(1, "context must not be code") : *(r.get_method_frame()->caller()); | Value *context=params.count()==3 ? &(params.as_no_junction(1, "context must not be code")) : r.get_method_frame()->caller(); |
| Value *value=context.get_element(name); | Value *value=context ? context->get_element(name) : 0; |
| if(value) { | if(value) { |
| if(type == "code" || type == "method") { | if(type == "code" || type == "method") { |
| Line 347 static void _is(Request& r, MethodParams | Line 347 static void _is(Request& r, MethodParams |
| r.write_no_lang(VBool::get( value->is(type.cstr()) )); | r.write_no_lang(VBool::get( value->is(type.cstr()) )); |
| } | } |
| } else | } else |
| r.write_no_lang(VBool::get(false)); | r.write_no_lang(VBool::get(type == "void")); |
| } | } |
| static void _copy(Request& r, MethodParams& params) { | static void _copy(Request& r, MethodParams& params) { |