コード例 #1
0
        public override void InitPrototype(IGlobal global)
        {
            ((JsFunction)Prototype).Scope = global.ObjectClass.Scope;
            Prototype.DefineOwnProperty("constructor", this, PropertyAttributes.DontEnum);

            Prototype.DefineOwnProperty(CALL.ToString(), new JsCallFunction(this), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty(APPLY.ToString(), new JsApplyFunction(this), PropertyAttributes.DontEnum);

            Prototype.DefineOwnProperty("toString", New <JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("toLocaleString", New <JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("length", new PropertyDescriptor <JsObject>(global, Prototype, "length", GetLengthImpl, SetLengthImpl));
        }
コード例 #2
0
        public override void InitPrototype(IGlobal global)
        {
            var Prototype = PrototypeProperty;

            // ((JsFunction)Prototype).Scope = global.ObjectClass.Scope;

            Prototype.DefineOwnProperty("constructor", this, PropertyAttributes.DontEnum);

            Prototype.DefineOwnProperty(CALL.ToString(), new JsCallFunction(this), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty(APPLY.ToString(), new JsApplyFunction(this), PropertyAttributes.DontEnum);

            Prototype.DefineOwnProperty("toString", New <JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty("toLocaleString", New <JsDictionaryObject>(ToString2), PropertyAttributes.DontEnum);
            Prototype.DefineOwnProperty(new PropertyDescriptor <JsObject>(global, Prototype, "length", GetLengthImpl, SetLengthImpl));

            if (global.HasOption(Options.Ecmascript5))
            {
                Prototype.DefineOwnProperty("bind", global.FunctionClass.New <JsObject>(Bind, 1), PropertyAttributes.DontEnum);
            }
        }