Ejemplo 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);
 }
Ejemplo 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());
        }
Ejemplo n.º 3
0
 public void Set(DObject obj, DFunction value) { Set(obj, (DObject)value); } //To make sure CodeGen can detect this
Ejemplo n.º 4
0
    public virtual void BlackList(DFunction func)
    {

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