示例#1
0
        public static TypeReference CreateTypeReference(Engine engine, Type type)
        {
            var obj = new TypeReference(engine);
            obj.Extensible = false;
            obj.Type = type;

            // The value of the [[Prototype]] internal property of the TypeReference constructor is the Function prototype object 
            obj.Prototype = engine.Function.PrototypeObject;

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

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

            return obj;
        }