Example #1
0
 public void Set(DObject obj, DFunction value) { Set(obj, (DObject)value); } //To make sure CodeGen can detect this
 public void Set(DObject obj, DArray value) { Set(obj, (DObject)value); } //To make sure CodeGen can detect this
Example #2
0
        //ECMA-262 section 15.2.3.14  
        void keys(ref mdr.CallFrame callFrame) 
        {
          Debug.WriteLine("calling JSObject.keys");
          var O = callFrame.Arg0.AsDObject();
          if (O == null)
            Trace.Fail("TypeError"); 
          var retArray = new DArray(O.Map.Property.Index + 1);
          var i = 0;

          for (var m = O.Map; m.Property.Name != null; m = m.Parent)
          {
            if (!m.Property.IsNotEnumerable && !m.Property.IsInherited && (m.Property.IsDataDescriptor || m.Property.IsAccessorDescriptor))
            {
              retArray.Elements[i++].Set(m.Property.Name);
            }
          }

          retArray.Length = i;

          //Debug.Assert(i == retArray.Length, "Array not populated correctly!");
          callFrame.Return.Set(retArray);

        }
Example #3
0
        }                                                                           //To make sure CodeGen can detect this

        public void Set(DObject obj, DArray value)
        {
            Set(obj, (DObject)value);
        }                                                                        //To make sure CodeGen can detect this
Example #4
0
        //ECMA-262 section 15.2.3.4   
        void getOwnPropertyNames(ref mdr.CallFrame callFrame) 
        {
          Debug.WriteLine("calling JSObject.getOwnPropertyNames");
          var O = callFrame.Arg0.AsDObject();
          if (O == null)
            Trace.Fail("TypeError");

          var retArray = new DArray(O.Map.Property.Index + 1);
          var i = 0;

          for (var m = O.Map; m.Property.Name != null; m = m.Parent)
          {
            retArray.Elements[i++].Set(m.Property.Name);
          }

          retArray.Length = i;

          //Debug.Assert(i == retArray.Length, "Array not populated correctly!");
          callFrame.Return.Set(retArray);
        }
Example #5
0
 public void Set(DArray v)
 {
     Set((DObject)v);
 }