Microsoft.JScript.ForIn.PartiallyEvaluate C# (CSharp) Method

PartiallyEvaluate() private method

private PartiallyEvaluate ( ) : AST
return AST
      internal override AST PartiallyEvaluate(){
        this.var = this.var.PartiallyEvaluateAsReference();
        this.var.SetPartialValue(new ConstantWrapper(null, null));
        if (this.initializer != null)
          this.initializer = this.initializer.PartiallyEvaluate();
        this.collection = this.collection.PartiallyEvaluate();
        IReflect ctype = this.collection.InferType(null);
        if ((ctype is ClassScope && ((ClassScope)ctype).noExpando && !((ClassScope)ctype).ImplementsInterface(Typeob.IEnumerable)) ||
            (ctype != Typeob.Object && ctype is Type && !(Typeob.ScriptObject.IsAssignableFrom((Type)ctype)) &&
            !Typeob.IEnumerable.IsAssignableFrom((Type)ctype) && !Typeob.IConvertible.IsAssignableFrom((Type)ctype))
            &&!Typeob.IEnumerator.IsAssignableFrom((Type)ctype))
          this.collection.context.HandleError(JSError.NotCollection);
        ScriptObject current_scope = Globals.ScopeStack.Peek();
        while (current_scope is WithObject) current_scope = current_scope.GetParent();
        if (current_scope is FunctionScope){
          FunctionScope scope = (FunctionScope)current_scope;
          BitArray before = scope.DefinedFlags;
          this.body = this.body.PartiallyEvaluate();
          scope.DefinedFlags = before;
        }else
          this.body = this.body.PartiallyEvaluate();
        return this;
      }