Esempio n. 1
0
 public static bool CallProperty(mdr.DObject input, string propName, out mdr.DValue output)
 {
     if (input != null)
     {
         var propDesc = input.GetPropertyDescriptor(propName);
         var prop     = new mdr.DValue();
         propDesc.Get(input, ref prop);
         mdr.DFunction func = null;
         if (prop.ValueType == mdr.ValueTypes.Function)
         {
             func = prop.AsDFunction();
             //if (toString != null)
             //{
             mdr.CallFrame callFrame = new mdr.CallFrame();
             callFrame.This     = (input);
             callFrame.Function = func;
             func.Call(ref callFrame);
             if (ValueTypesHelper.IsPrimitive(callFrame.Return.ValueType))
             {
                 output = callFrame.Return;
                 return(true);
             }
         }
     }
     output = new mdr.DValue();
     output.SetUndefined();
     return(false);
 }
Esempio n. 2
0
        public static bool Run(mdr.DObject i0, mdr.DFunction i1)
        {
            //var prototype = func.GetFieldByFieldIndex(mdr.DType.PrototypeIndex);
            var prototype = new mdr.DValue();

            i1.PrototypePropertyDescriptor.Get(i1, ref prototype);
            return(i0.Prototype == prototype.AsDObject());
        }
Esempio n. 3
0
 public void Set(DObject obj, DFunction value) { Set(obj, (DObject)value); } //To make sure CodeGen can detect this
Esempio n. 4
0
    public virtual void BlackList(DFunction func)
    {

    }
Esempio n. 5
0
 public void Set(DObject obj, DFunction value)
 {
     Set(obj, (DObject)value);
 }                                                                           //To make sure CodeGen can detect this
Esempio n. 6
0
 public virtual void BlackList(DFunction func)
 {
 }
Esempio n. 7
0
 public void Set(DFunction v)
 {
     Set((DObject)v);
 }
Esempio n. 8
0
 public static void UpdateCallProfile(CodeGen.Profiler profiler, int profileIndex, DFunction function)
 {
   if (profiler != null)
       profiler.GetOrAddCallNodeProfile(profileIndex).UpdateNodeProfile(function);
 }