ToObject3() 정적인 개인적인 메소드

static private ToObject3 ( Object value, VsaEngine engine ) : Object
value Object
engine Microsoft.JScript.Vsa.VsaEngine
리턴 Object
예제 #1
0
        internal override Object Construct(Object[] args)
        {
            if (args.Length == 0)
            {
                return(this.ConstructObject());
            }
            Object val = args[0];

            switch (Convert.GetTypeCode(val))
            {
            case TypeCode.Empty:
            case TypeCode.DBNull: return(this.ConstructObject());

            case TypeCode.Object:
                if (val is ScriptObject)
                {
                    return(val);
                }
                IReflect ir = null;
                if (val is IReflect)
                {
                    ir = (IReflect)val;
                }
                else
                {
                    ir = val.GetType();
                }
                const BindingFlags flags =
                    BindingFlags.Public | BindingFlags.OptionalParamBinding |
                    BindingFlags.CreateInstance;
                return(ir.InvokeMember(String.Empty, flags, JSBinder.ob, val, new Object[0], null, null, null));
            }
            return(Convert.ToObject3(val, this.engine));
        }
예제 #2
0
        internal override Object Call(Object[] args, Object thisob)
        {
            if (args.Length == 0)
            {
                return(this.ConstructObject());
            }
            Object val = args[0];

            if (val == null || val == DBNull.Value)
            {
                return(this.Construct(args));
            }
            else
            {
                return(Convert.ToObject3(val, this.engine));
            }
        }