Microsoft.JScript.PostOrPrefixOperator.GetOperator C# (CSharp) Method

GetOperator() private method

private GetOperator ( IReflect ir ) : MethodInfo
ir IReflect
return MethodInfo
      private MethodInfo GetOperator(IReflect ir){
        Type t = ir is Type ? (Type)ir : Typeob.Object;
        if (this.type == t)
          return this.operatorMeth;
        this.type = t;
        if (Convert.IsPrimitiveNumericType(t) || Typeob.JSObject.IsAssignableFrom(t)){
          this.operatorMeth = null;
          return null;
        }
        switch (this.operatorTok){
          case PostOrPrefix.PostfixDecrement:
          case PostOrPrefix.PrefixDecrement:
            this.operatorMeth = t.GetMethod("op_Decrement", BindingFlags.Public|BindingFlags.Static, JSBinder.ob, new Type[]{t}, null); break;
          case PostOrPrefix.PostfixIncrement:
          case PostOrPrefix.PrefixIncrement:
            this.operatorMeth = t.GetMethod("op_Increment", BindingFlags.Public|BindingFlags.Static, JSBinder.ob, new Type[]{t}, null); break;
          default:
            throw new JScriptException(JSError.InternalError, this.context);
        }
        if (this.operatorMeth != null && 
        (!this.operatorMeth.IsStatic || (operatorMeth.Attributes & MethodAttributes.SpecialName) == (MethodAttributes)0 || operatorMeth.GetParameters().Length != 1))
          this.operatorMeth = null;
        if (this.operatorMeth != null)
          this.operatorMeth = new JSMethodInfo(this.operatorMeth);
        return this.operatorMeth;  
      }