Added ThrowsError() and IsEmpty() extension methods for MethodInfo.
This commit is contained in:
parent
9c02bf77ba
commit
2c79016725
|
@ -22,6 +22,18 @@ namespace BizHawk.Emulation.Common.IEmulatorExtensions
|
|||
return !info.GetCustomAttributes(false).OfType<FeatureNotImplemented>().Any();
|
||||
}
|
||||
|
||||
public static bool ThrowsError(this MethodInfo info)
|
||||
{
|
||||
var il = info.GetMethodBody().GetILAsByteArray();
|
||||
return (il[il.Length - 1] == 0x7A);
|
||||
}
|
||||
|
||||
public static bool IsEmpty(this MethodInfo info)
|
||||
{
|
||||
var il = info.GetMethodBody().GetILAsByteArray();
|
||||
return (il.Length == 1 && il[0] == 0x2A);
|
||||
}
|
||||
|
||||
public static bool IsImplemented(this PropertyInfo info)
|
||||
{
|
||||
return !info.GetCustomAttributes(false).OfType<FeatureNotImplemented>().Any();
|
||||
|
|
Loading…
Reference in New Issue