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);
            }
        }