--- parser3/src/main/execute.C 2001/04/28 08:43:57 1.149 +++ parser3/src/main/execute.C 2001/05/04 11:08:09 1.151 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: execute.C,v 1.149 2001/04/28 08:43:57 paf Exp $ + $Id: execute.C,v 1.151 2001/05/04 11:08:09 paf Exp $ */ #include "pa_config_includes.h" @@ -221,6 +221,10 @@ void Request::execute(const Array& ops) { Value *value=POP(); write_assign_lang(*value); + + // forget the fact they've entered some ^object.method[]. + // see OP_GET_ELEMENT + wcontext->clear_somebody_entered_some_object(); break; } case OP_WRITE_EXPR_RESULT: @@ -239,6 +243,9 @@ void Request::execute(const Array& ops) case OP_GET_ELEMENT: { + // maybe they do ^object.method[] call, remember the fact + wcontext->inc_somebody_entered_some_object(); + Value *value=get_element(); PUSH(value); break; @@ -357,9 +364,12 @@ void Request::execute(const Array& ops) PUSH(wcontext); VStateless_class *called_class=frame->junction.self.get_class(); + // not ^name.method call and // is context object or class & is it my class or my parent's class? VStateless_class *read_class=rcontext->get_class(); - if(read_class && read_class->is_or_derived_from(*called_class)) // yes + if( + !wcontext->somebody_entered_some_object() && + read_class && read_class->is_or_derived_from(*called_class)) // yes self=rcontext; // class dynamic call else // no, not me or relative of mine (total stranger) if(frame->is_constructor) { @@ -449,7 +459,8 @@ void Request::execute(const Array& ops) { Value *operand=POP(); const char *path=operand->as_string().cstr(); - Value *value=NEW VBool(pool(), info.uri && strcmp(path, info.uri)<=0); + Value *value=NEW VBool(pool(), + info.uri && strncmp(path, info.uri, strlen(path))==0); PUSH(value); break; }