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

PartiallyEvaluate() private method

private PartiallyEvaluate ( ) : AST
return AST
      internal override AST PartiallyEvaluate(){
        this.BindName(null);
        if (this.members == null || this.members.Length == 0){
          //if this rootObject is a constant and its value is a namespace, turn this node also into a namespace constant
          if (this.rootObject is ConstantWrapper){
            Object val = this.rootObject.Evaluate();
            if (val is Namespace){
              return new ConstantWrapper(Namespace.GetNamespace(((Namespace)val).Name+"."+this.name, this.Engine), this.context);
            }
          }
          this.HandleNoSuchMemberError();
          return this;
        }
        this.ResolveRHValue();
        if (this.member is FieldInfo && ((FieldInfo)this.member).IsLiteral){
          Object val = this.member is JSVariableField ? ((JSVariableField)this.member).value : TypeReferences.GetConstantValue((FieldInfo)this.member);
          if (val is AST){
            AST pval = ((AST)val).PartiallyEvaluate();
            if (pval is ConstantWrapper)
              return pval;
            val = null;
          }
          if (!(val is FunctionObject) && (!(val is ClassScope) || ((ClassScope)val).owner.IsStatic))
            return new ConstantWrapper(val, this.context);
        }else if (this.member is Type)
          return new ConstantWrapper(this.member, this.context);
        return this;
      }