Set() публичный Метод

public Set ( JsDictionaryObject that, JsInstance value ) : void
that JsDictionaryObject
value JsInstance
Результат void
Пример #1
0
        public JsArguments(IGlobal global, JsFunction callee, JsInstance[] arguments)
            : base()
        {
            this.args   = arguments;
            this.global = global;
            Prototype   = global.ObjectClass.New();
            // Add the named parameters
            for (int i = 0; i < Math.Max(arguments.Length, callee.Arguments.Count); i++)
            {
                ValueDescriptor d = new ValueDescriptor(this, i < callee.Arguments.Count ? callee.Arguments[i] : i.ToString());

                d.Set(this, i < arguments.Length ? arguments[i] : JsUndefined.Instance);

                if (i < callee.Arguments.Count)
                {
                    this.DefineOwnProperty(callee.Arguments[i], d);
                }
                this.DefineOwnProperty(i.ToString(), d);
            }

            length           = arguments.Length;
            calleeDescriptor = new ValueDescriptor(this, "callee");
            DefineOwnProperty("callee", calleeDescriptor);
            calleeDescriptor.Set(this, callee);
            DefineOwnProperty("length", new PropertyDescriptor <JsArguments>(global, this, "length", GetLength));
            DefineOwnProperty("array", new PropertyDescriptor <JsArguments>(global, this, "array", GetArray));
        }
Пример #2
0
        public JsArguments(IGlobal global, JsFunction callee, JsInstance[] arguments)
            : base()
        {
			this.args = arguments;
            this.global = global;
            Prototype = global.ObjectClass.New();
            // Add the named parameters
            for (int i = 0; i < Math.Max(arguments.Length, callee.Arguments.Count); i++)
            {
                ValueDescriptor d = new ValueDescriptor(this, i < callee.Arguments.Count ? callee.Arguments[i] : i.ToString());

                d.Set(this, i < arguments.Length ? arguments[i] : JsUndefined.Instance);

                if (i < callee.Arguments.Count)
                    this.DefineOwnProperty(callee.Arguments[i], d);
                this.DefineOwnProperty(i.ToString(), d);
            }

            length = arguments.Length;
            calleeDescriptor = new ValueDescriptor(this, "callee");
            DefineOwnProperty("callee", calleeDescriptor);
            calleeDescriptor.Set(this, callee);
            DefineOwnProperty("length", new PropertyDescriptor<JsArguments>(global, this, "length", GetLength));
			DefineOwnProperty("array", new PropertyDescriptor<JsArguments>(global, this, "array", GetArray));
        }
Пример #3
0
        public JsArguments(IGlobal global, JsFunction callee, JsInstance[] arguments)
            : base(global.ObjectClass.New())
        {
            this.global = global;
            // Add the named parameters
            for (int i = 0; i < Math.Max(arguments.Length, callee.Arguments.Count); i++)
            {
                ValueDescriptor d = new ValueDescriptor(this, i < callee.Arguments.Count ? callee.Arguments[i] : i.ToString())
                {
                    Attributes = PropertyAttributes.DontDelete
                };

                d.Set(this, i < arguments.Length ? arguments[i] : JsUndefined.Instance);

                this.DefineOwnProperty(i.ToString(), d);
            }

            length = arguments.Length;

            calleeDescriptor = new ValueDescriptor(this, CALLEE)
            {
                Attributes = PropertyAttributes.DontEnum
            };
            DefineOwnProperty(CALLEE, calleeDescriptor);
            calleeDescriptor.Set(this, callee);

            DefineOwnProperty("length", new PropertyDescriptor <JsArguments>(global, this, "length", GetLength)
            {
                Attributes = PropertyAttributes.DontEnum
            });
        }
Пример #4
0
        public JsArguments(IGlobal global, JsFunction callee, JsInstance[] arguments)
            : base(global.ObjectClass.New())
        {
            this.global = global;
            // Add the named parameters
            for (int i = 0; i < Math.Max(arguments.Length, callee.Arguments.Count); i++) {
                ValueDescriptor d = new ValueDescriptor(this, i < callee.Arguments.Count ? callee.Arguments[i] : i.ToString()) { Attributes = PropertyAttributes.DontDelete };

                d.Set(this, i < arguments.Length ? arguments[i] : JsUndefined.Instance);

                this.DefineOwnProperty(i.ToString(), d);
            }

            length = arguments.Length;

            calleeDescriptor = new ValueDescriptor(this, CALLEE) { Attributes = PropertyAttributes.DontEnum };
            DefineOwnProperty(CALLEE, calleeDescriptor);
            calleeDescriptor.Set(this, callee);

            DefineOwnProperty("length", new PropertyDescriptor<JsArguments>(global, this, "length", GetLength) { Attributes = PropertyAttributes.DontEnum });
        }