Set() public method

public Set ( JsDictionaryObject that, JsInstance value ) : void
that JsDictionaryObject
value JsInstance
return void
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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
            });
        }
Exemplo n.º 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 });
        }