Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@@ -43,22 +43,12 @@ namespace System
public static Type GetType(string typeName)
{
if (typeName == null)
throw new ArgumentNullException ("TypeName");
return internal_from_name (typeName, false, false);
return GetType (typeName, false, false);
}
public static Type GetType(string typeName, bool throwOnError)
{
if (typeName == null)
throw new ArgumentNullException ("TypeName");
Type type = internal_from_name (typeName, throwOnError, false);
if (throwOnError && type == null)
throw new TypeLoadException ("Error loading '" + typeName + "'");
return type;
return GetType (typeName, throwOnError, false);
}
public static Type GetType(string typeName, bool throwOnError, bool ignoreCase)
@@ -66,6 +56,11 @@ namespace System
if (typeName == null)
throw new ArgumentNullException ("TypeName");
if (typeName == String.Empty)
if (throwOnError)
throw new TypeLoadException ("A null or zero length string does not represent a valid Type.");
else
return null;
Type t = internal_from_name (typeName, throwOnError, ignoreCase);
if (throwOnError && t == null)
throw new TypeLoadException ("Error loading '" + typeName + "'");
@@ -82,6 +77,8 @@ namespace System
{
if (typeName == null)
throw new ArgumentNullException ("typeName");
if (typeName == String.Empty && throwIfNotFound)
throw new TypeLoadException ("A null or zero length string does not represent a valid Type");
int idx = typeName.IndexOf (',');
if (idx < 0 || idx == 0 || idx == typeName.Length - 1)
throw new ArgumentException ("Assembly qualifed type name is required", "typeName");