--- parser3/src/main/execute.C 2002/06/20 14:50:23 1.242 +++ parser3/src/main/execute.C 2002/08/08 14:04:48 1.246 @@ -3,10 +3,10 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: execute.C,v 1.242 2002/06/20 14:50:23 paf Exp $ */ +static const char* IDENT_EXECUTE_C="$Date: 2002/08/08 14:04:48 $"; + #include "pa_opcode.h" #include "pa_array.h" #include "pa_request.h" @@ -1007,19 +1007,18 @@ void Request::execute_method(Value& asel } local_frame.set_self(*self); root=rcontext=wcontext=&local_frame; + + // prevent non-string writes for better error reporting + if(return_string) + wcontext->write(local_frame); // execute! execute(*method.parser_code); // result const String *result=0; - if(return_string) { - /*if(Value *result_var_value=wcontext->get_element(*result_var_name)) - *return_string=&result_var_value->as_string(); - else - *return_string=&wcontext->as_string();*/ + if(return_string) *return_string=&wcontext->result().as_string(); - } wcontext=static_cast(POP()); rcontext=POP();