pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:1:   /* -*- Pike -*-    * -  * $Id: master.pike.in,v 1.135 2000/11/20 01:26:26 mast Exp $ +  * $Id: master.pike.in,v 1.136 2000/12/02 16:21:36 mast Exp $    *    * Master-file for Pike.    *    * Based on master.pike 1.67.    */      // Some configurable parameters useful for debugging      #pike __REAL_VERSION__   #define PIKE_AUTORELOAD
pike.git/lib/master.pike.in:462:   {    if(mixed x=catch {    werror(describe_backtrace(trace));    })    {    // One reason for this might be too little stack space, which    // easily can occur for "out of stack" errors. It should help to    // tune up the STACK_MARGIN values in interpret.c then.    werror("Error in handle_error in master object:\n");    if(catch { +  if (catch { +  string msg = x[0]; +  array bt = x[1]; +  werror ("%s%O\nOriginal error:\n%O\n", msg, bt, trace); +  })    werror("%O\nOriginal error:\n%O\n",x,trace);    }) {    werror("sprintf() failed to write error.\n");    }    }   }      object new(mixed prog, mixed ... args)   {    if(stringp(prog))
pike.git/lib/master.pike.in:653:    }    if (program p=cast_to_program( index, 0 )) return p;    return UNDEFINED;    }       mixed `[](string index)    {    mixed ret;    if(!zero_type(ret=cache[index]))    { -  if(ret!=0) return ret; +  // The check below is to (hopefully) avoid calling any function +  // in ret (like `! or `==) in case it's an object. +  if(!intp (ret) || ret) return ret;    return UNDEFINED;    }    return cache[index]=ind(index);    }       static int _cache_full;    void fill_cache()    {   #ifdef RESOLV_DEBUG    werror(describe_backtrace(({ sprintf("Filling cache in dirnode %O\n",
pike.git/lib/master.pike.in:702:    "%s\n",    describe_backtrace(err)));    }    }    _cache_full = 1;    }    array(string) _indices()    {    // werror("indices(%O) called\n", dirname);    fill_cache(); -  return indices(filter(cache, lambda(mixed x){ return x!=0; })); +  return indices(filter(cache, lambda(mixed x){ return !intp (x) || x; }));    }    array(mixed) _values()    {    // werror("values(%O) called\n", dirname);    fill_cache();    return values(cache)-({0});    }       string _sprintf(int as)    {
pike.git/lib/master.pike.in:1747:    {    if(sscanf(reverse(s),"%s.%s",string ext,string rest) && ext=="domp")    name = EXPLODE_PATH(reverse(rest))[-1];    else    name = trim_file_name(s);    }    else    if (catch (name = function_name (f))) name = "function";       object o = function_object(f); -  if(o != 0) { // Testing simply on o here could invoke a `!. +  if(objectp (o)) { // Check if it's an object in a way that (hopefully) doesn't +  // call any functions in it (neither `== nor `!).    string s;    if (!catch (s = sprintf("%O",o)) && s != "object")    return s+"->"+name;    }    return name;   }      /* It is possible that this should be a real efun,    * it is currently used by handle_error to convert a backtrace to a    * readable message.