Branch: Tag:

2012-08-15

2012-08-15 11:49:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Roxen.EScope: Increased leniency for the `-> operator.

The `-> operator may be called with arbitrary symbols in strange contexts
(cf eg master()->describe_object()), which don't expect errors to be thrown.
Potential fix for [bug 6451 (#6451)] #2.

Rev: server/etc/modules/Roxen.pmod:1.333

1:   // This is a roxen pike module. Copyright © 1999 - 2009, Roxen IS.   // - // $Id: Roxen.pmod,v 1.332 2012/06/28 12:05:13 mast Exp $ + // $Id: Roxen.pmod,v 1.333 2012/08/15 11:49:09 grubba Exp $      #include <roxen.h>   #include <config.h>
4235:       protected mixed `->( string what )    { -  return `[]( what ); +  // NB: This function may be called by eg master()->describe_object() +  // with symbols such as "is_resolv_dirnode", in contexts where +  // the scope doesn't exist. cf [bug 6451]. +  return ctx->scopes[scope || "_"] && `[]( what );    }       protected mixed `[]=( string what, mixed nval )