コード例 #1
0
ファイル: UuidPrototype.cs プロジェクト: KurtGokhan/jint
        public static UuidPrototype CreatePrototypeObject(Engine engine, UuidConstructor ctor)
        {
            var obj = new UuidPrototype(engine)
            {
                PrimitiveValue = JsUuid.Empty,
                _prototype     = engine.Realm.Intrinsics.Object.PrototypeObject,
            };

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

            return(obj);
        }
コード例 #2
0
ファイル: UuidConstructor.cs プロジェクト: KurtGokhan/jint
        public static UuidConstructor CreateUuidConstructor(Engine engine)
        {
            var obj = new UuidConstructor(engine)
            {
                // The value of the [[Prototype]] internal property of the Uuid constructor is the Function prototype object
                _prototype = engine.Realm.Intrinsics.Function.PrototypeObject
            };

            obj.PrototypeObject = UuidPrototype.CreatePrototypeObject(engine, obj);

            // The initial value of Uuid.prototype is the Date prototype object
            obj.SetOwnProperty("prototype", new PropertyDescriptor(obj.PrototypeObject, false, false, false));

            engine.SetValue("Uuid", obj);
            obj.Configure();
            obj.PrototypeObject.Configure();

            return(obj);
        }