コード例 #1
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;
        }
コード例 #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 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;
        }
コード例 #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);
        }