Ejemplo n.º 1
0
        internal object CallGetter(CodeContext context, SiteLocalStorage <CallSite <Func <CallSite, CodeContext, object, object[], object> > > storage, object instance, object[] args)
        {
            if (NeedToReturnProperty(instance, Getter))
            {
                return(this);
            }

            if (Getter.Length == 0)
            {
                throw new MissingMemberException("unreadable property");
            }

            if (_getfunc == null)
            {
                lock (this) {
                    if (_getfunc == null)
                    {
                        MakeGetFunc();
                    }
                }
            }

            return(_getfunc.Call(context, storage, instance, args));
        }
Ejemplo n.º 2
0
        internal object CallTarget(CodeContext context, SiteLocalStorage <CallSite <Func <CallSite, CodeContext, object, object[], object> > > storage, MethodInfo[] targets, object instance, params object[] args)
        {
            BuiltinFunction target = PythonTypeOps.GetBuiltinFunction(DeclaringType, __name__, targets);

            return(target.Call(context, storage, instance, args));
        }