예제 #1
0
        //public override RuntimeObj ToPrimitive( GlobalContext c )
        //{
        //    return c.CreateString( JSSupport.ToString( _value ) );
        //}

        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            JSEvalDate d = obj as JSEvalDate;

            return(d != null ? d._value == _value : false);
        }
예제 #2
0
        public int CompareTo(object obj)
        {
            JSEvalDate d = obj as JSEvalDate;

            if (d != null)
            {
                return(_value.CompareTo(d._value));
            }
            if (obj is DateTime)
            {
                return(_value.CompareTo((DateTime)obj));
            }
            throw new ArgumentException("Must be a Date.", "obj");
        }
예제 #3
0
 public GlobalContext()
 {
     _epoch = new JSEvalDate(JSSupport.JSEpoch);
 }