--- parser3/src/main/execute.C 2007/04/23 10:30:31 1.316 +++ parser3/src/main/execute.C 2007/11/29 08:07:26 1.318 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_EXECUTE_C="$Date: 2007/04/23 10:30:31 $"; +static const char * const IDENT_EXECUTE_C="$Date: 2007/11/29 08:07:26 $"; #include "pa_opcode.h" #include "pa_array.h" @@ -928,12 +928,13 @@ StringOrValue Request::process(Value& in if(junction->is_getter) { // is it a getter-junction? // process it - VMethodFrame frame(*junction, method_frame/*caller*/); if(junction->method->params_names) throw Exception(PARSER_RUNTIME, 0, "getter method must have no parameters"); + VMethodFrame frame(*junction, method_frame/*caller*/); + frame.set_self(frame.junction.self); VMethodFrame *saved_method_frame=method_frame; @@ -977,18 +978,16 @@ StringOrValue Request::process(Value& in // using the fact in decision "which wwrapper to use" bool using_code_frame=intercept_string && junction->wcontext; if(using_code_frame) { - // almost plain wwrapper about junction wcontext, - // BUT intercepts string writes - VCodeFrame local(*junction->wcontext, junction->wcontext); + // almost plain wwrapper about junction wcontext + + VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recoursion_checked_execute(*junction->code); // CodeFrame soul: - // string writes were intercepted - // returning them as the result of getting code-junction - result.set_string(*wcontext->get_string()); + result=wcontext->result(); } else { // plain wwrapper WWrapper local(0/*empty*/, wcontext); @@ -1042,6 +1041,7 @@ StringOrValue Request::execute_method(VM const String* Request::execute_method(Value& aself, const Method& method, VString* optional_param, bool do_return_string) { + VMethodFrame *saved_method_frame=method_frame; Value* saved_rcontext=rcontext; WContext *saved_wcontext=wcontext; @@ -1076,13 +1076,13 @@ const String* Request::execute_method(Va Request::Execute_nonvirtual_method_result Request::execute_nonvirtual_method(VStateless_class& aclass, - const String& method_name, VString* optional_param, + const String& method_name, + VString* optional_param, bool do_return_string) { Execute_nonvirtual_method_result result; result.method=aclass.get_method(method_name); if(result.method) - result.string=execute_method(aclass, *result.method, optional_param, - do_return_string); + result.string=execute_method(aclass, *result.method, optional_param, do_return_string); return result; }