示例#1
0
        public static ApiObjectPrototype CreatePrototypeObject(CpuBlock block, ApiObjectConstructor constructor, List <CpuApiProperty> props)
        {
            var obj = new ApiObjectPrototype(block, props)
            {
                _prototype   = block.Interp.Object.PrototypeObject,
                _constructor = constructor
            };

            return(obj);
        }
示例#2
0
        public static ApiObjectConstructor CreateApiConstructor(CpuBlock cpu, string name, List <CpuApiProperty> staticProps, List <CpuApiProperty> instanceProps)
        {
            var obj = new ApiObjectConstructor(cpu, name, staticProps)
            {
                _prototype = cpu.Interp.Function.PrototypeObject,
            };

            obj.PrototypeObject      = ApiObjectPrototype.CreatePrototypeObject(cpu, obj, instanceProps);
            obj._prototypeDescriptor = new PropertyDescriptor(obj.PrototypeObject, PropertyFlag.AllForbidden);
            return(obj);
        }