Remove Platform.HasCom query

This commit is contained in:
Andrew Schwartzmeyer
2016-07-14 17:34:12 -07:00
parent 5ef851a170
commit 46cfa26812
4 changed files with 8 additions and 28 deletions
@@ -217,14 +217,6 @@ namespace System.Management.Automation
}
// ComObjectType is null on CoreCLR for Linux since there is
// no COM support on Linux
internal static bool HasCom()
{
// TODO: catch exception from Type.IsComObject
return IsWindows;
}
// The Antimalware Scan Interface is not supported on Linux
internal static bool HasAmsi()
{
@@ -677,14 +677,11 @@ namespace System.Management.Automation.Language
private static TypeInfo GetComObjectType()
{
if (Platform.HasCom())
{
return typeof(object).GetTypeInfo().Assembly.GetType("System.__ComObject").GetTypeInfo();
}
else
{
return null;
}
#if LINUX
return null;
#else
return typeof(object).GetTypeInfo().Assembly.GetType("System.__ComObject").GetTypeInfo();
#endif
}
internal static bool IsComObject(object obj)
@@ -130,12 +130,9 @@ namespace System.Management.Automation
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static bool IsComObject(this Type type)
{
if (!Platform.HasCom())
{
return false;
}
#if CORECLR // Type.IsComObject(Type) is not in CoreCLR
#if LINUX
return false;
#elif CORECLR // Type.IsComObject(Type) is not in CoreCLR
return ComObjectType.IsAssignableFrom(type);
#else
return type.IsCOMObject;
-6
View File
@@ -15,12 +15,6 @@ namespace PSTests
Assert.True(Platform.IsCore);
}
[Fact]
public static void TestHasCom()
{
Assert.False(Platform.HasCom());
}
[Fact]
public static void TestHasAmsi()
{