SetValue() private method

private SetValue ( Object value ) : void
value Object
return void
        internal override object Evaluate()
        {
            AST var = this.var;

            if (this.initializer != null)
            {
                this.initializer.Evaluate();
            }
            this.completion.Continue = 0;
            this.completion.Exit     = 0;
            this.completion.value    = null;
            object      coll       = Microsoft.JScript.Convert.ToForInObject(this.collection.Evaluate(), base.Engine);
            IEnumerator enumerator = null;

            try
            {
                enumerator = JScriptGetEnumerator(coll);
                goto Label_00F4;
            }
            catch (JScriptException exception)
            {
                exception.context = this.collection.context;
                throw exception;
            }
Label_0078:
            var.SetValue(enumerator.Current);
            Completion completion = (Completion)this.body.Evaluate();

            this.completion.value = completion.value;
            if (completion.Continue > 1)
            {
                this.completion.Continue = completion.Continue - 1;
                goto Label_00FF;
            }
            if (completion.Exit > 0)
            {
                this.completion.Exit = completion.Exit - 1;
                goto Label_00FF;
            }
            if (completion.Return)
            {
                return(completion);
            }
Label_00F4:
            if (enumerator.MoveNext())
            {
                goto Label_0078;
            }
Label_00FF:
            return(this.completion);
        }
Example #2
0
        internal override Object Evaluate()
        {
            AST r = this.var;

            if (this.initializer != null)
            {
                this.initializer.Evaluate();
            }
            this.completion.Continue = 0;
            this.completion.Exit     = 0;
            this.completion.value    = null;
            Object      coll           = Convert.ToForInObject(this.collection.Evaluate(), this.Engine);
            bool        isScriptObject = coll is ScriptObject;
            IEnumerator e = null;

            try{
                e = JScriptGetEnumerator(coll);
            }catch (JScriptException x) {
                x.context = this.collection.context;
                throw x;
            }
            while (e.MoveNext())
            {
                r.SetValue(e.Current);
                Completion c = (Completion)this.body.Evaluate();
                this.completion.value = c.value;
                if (c.Continue > 1)
                {
                    this.completion.Continue = c.Continue - 1;
                    break;
                }
                if (c.Exit > 0)
                {
                    this.completion.Exit = c.Exit - 1;
                    break;
                }
                if (c.Return)
                {
                    return(c);
                }
            }
            return(this.completion);
        }
Example #3
0
 internal override Object Evaluate()
 {
     try{
         if (this.lhside is Call)
         {
             ((Call)this.lhside).EvaluateIndices();
         }
         Object val = this.rhside.Evaluate();
         lhside.SetValue(val);
         return(val);
     }catch (JScriptException e) {
         if (e.context == null)
         {
             e.context = this.context;
         }
         throw e;
     }catch (Exception e) {
         throw new JScriptException(e, this.context);
     }
 }