Пример #1
0
        public static DatePrototype CreatePrototypeObject(Engine engine, DateConstructor dateConstructor)
        {
            var obj = new DatePrototype(engine)
            {
                _prototype       = engine.Object.PrototypeObject,
                _dateConstructor = dateConstructor
            };

            return(obj);
        }
Пример #2
0
        public static DatePrototype CreatePrototypeObject(Engine engine, DateConstructor dateConstructor)
        {
            var obj = new DatePrototype(engine)
            {
                Prototype = engine.Object.PrototypeObject, 
                Extensible = true,
                PrimitiveValue = double.NaN
            };

            obj.FastAddProperty("constructor", dateConstructor, true, false, true);

            return obj;
        }
Пример #3
0
        public static DatePrototype CreatePrototypeObject(Engine engine, DateConstructor dateConstructor)
        {
            var obj = new DatePrototype(engine)
            {
                Prototype      = engine.Object.PrototypeObject,
                Extensible     = true,
                PrimitiveValue = double.NaN
            };

            obj.FastAddProperty("constructor", dateConstructor, true, false, true);

            return(obj);
        }
Пример #4
0
        public static DateConstructor CreateDateConstructor(Engine engine)
        {
            var obj = new DateConstructor(engine);
            obj.Extensible = true;

            // The value of the [[Prototype]] internal property of the Date constructor is the Function prototype object 
            obj.Prototype = engine.Function.PrototypeObject;
            obj.PrototypeObject = DatePrototype.CreatePrototypeObject(engine, obj);

            obj.FastAddProperty("length", 7, false, false, false);

            // The initial value of Date.prototype is the Date prototype object
            obj.FastAddProperty("prototype", obj.PrototypeObject, false, false, false);

            return obj;
        }
Пример #5
0
        public static DateConstructor CreateDateConstructor(Engine engine)
        {
            var obj = new DateConstructor(engine);

            obj.Extensible = true;

            // The value of the [[Prototype]] internal property of the Date constructor is the Function prototype object
            obj.Prototype       = engine.Function.PrototypeObject;
            obj.PrototypeObject = DatePrototype.CreatePrototypeObject(engine, obj);

            obj.FastAddProperty("length", 7, false, false, false);

            // The initial value of Date.prototype is the Date prototype object
            obj.FastAddProperty("prototype", obj.PrototypeObject, false, false, false);

            return(obj);
        }
Пример #6
0
        public static DateConstructor CreateDateConstructor(Engine engine)
        {
            var obj = new DateConstructor(engine)
            {
                _prototype = engine.Function.PrototypeObject
            };

            // The value of the [[Prototype]] internal property of the Date constructor is the Function prototype object
            obj.PrototypeObject = DatePrototype.CreatePrototypeObject(engine, obj);

            obj._length = new PropertyDescriptor(7, PropertyFlag.Configurable);

            // The initial value of Date.prototype is the Date prototype object
            obj._prototypeDescriptor = new PropertyDescriptor(obj.PrototypeObject, PropertyFlag.AllForbidden);

            return(obj);
        }