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

PartiallyEvaluate() private method

private PartiallyEvaluate ( ) : AST
return AST
      internal override AST PartiallyEvaluate(){
        this.condition = this.condition.PartiallyEvaluate();
        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.operand1 = this.operand1.PartiallyEvaluate();
          BitArray after1 = scope.DefinedFlags;
          scope.DefinedFlags = before;
          this.operand2 = this.operand2.PartiallyEvaluate();
          BitArray after2 = scope.DefinedFlags;
          int n = after1.Length;
          int m = after2.Length;
          if (n < m) after1.Length = m;
          if (m < n) after2.Length = n;
          scope.DefinedFlags = after1.And(after2);
        }else{
          this.operand1 = this.operand1.PartiallyEvaluate();
          this.operand2 = this.operand2.PartiallyEvaluate();
        }
        return this;
      }