Jurassic.Compiler.DynamicILGenerator.ToVESType C# (CSharp) Method

ToVESType() private static method

Converts a .NET type into an IL operand type.
private static ToVESType ( Type type ) : VESType
type System.Type The type to convert.
return VESType
        private static VESType ToVESType(Type type)
        {
            switch (Type.GetTypeCode(type))
            {
                case TypeCode.Char:
                case TypeCode.Boolean:
                case TypeCode.SByte:
                case TypeCode.Int16:
                case TypeCode.Int32:
                case TypeCode.Byte:
                case TypeCode.UInt16:
                case TypeCode.UInt32:
                    return VESType.Int32;
                case TypeCode.Int64:
                case TypeCode.UInt64:
                    return VESType.Int64;
                case TypeCode.Single:
                case TypeCode.Double:
                    return VESType.Float;
                case TypeCode.String:
                    return VESType.Object;
                case TypeCode.DateTime:
                case TypeCode.Decimal:
                case TypeCode.Object:
                    if (type == typeof(IntPtr))
                        return VESType.NativeInt;
                    else if (type.IsValueType == true)
                        return VESType.ManagedPointer;
                    return VESType.Object;
                default:
                    throw new NotImplementedException(string.Format("Unsupported type {0}", type));
            }
        }
DynamicILGenerator