Rearranged checks (#92)
* Rearranged checks Rearranged checks so that the method is completed as quickly as possible * Typo
This commit is contained in:
parent
c74b6d4fa7
commit
c061f764bd
@ -19,7 +19,7 @@ namespace System.Diagnostics
|
||||
{
|
||||
public partial class EnhancedStackTrace
|
||||
{
|
||||
private static readonly Type StackTraceHiddenAttibuteType = Type.GetType("System.Diagnostics.StackTraceHiddenAttribute", false);
|
||||
private static readonly Type StackTraceHiddenAttributeType = Type.GetType("System.Diagnostics.StackTraceHiddenAttribute", false);
|
||||
|
||||
private static List<EnhancedStackFrame> GetFrames(Exception exception)
|
||||
{
|
||||
@ -625,7 +625,24 @@ namespace System.Diagnostics
|
||||
private static bool ShowInStackTrace(MethodBase method)
|
||||
{
|
||||
Debug.Assert(method != null);
|
||||
|
||||
if (StackTraceHiddenAttributeType != null)
|
||||
{
|
||||
// Don't show any methods marked with the StackTraceHiddenAttribute
|
||||
// https://github.com/dotnet/coreclr/pull/14652
|
||||
if (IsStackTraceHidden(method))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var type = method.DeclaringType;
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (type == typeof(Task<>) && method.Name == "InnerInvoke")
|
||||
{
|
||||
return false;
|
||||
@ -652,22 +669,7 @@ namespace System.Diagnostics
|
||||
}
|
||||
}
|
||||
|
||||
if (StackTraceHiddenAttibuteType != null)
|
||||
{
|
||||
// Don't show any methods marked with the StackTraceHiddenAttribute
|
||||
// https://github.com/dotnet/coreclr/pull/14652
|
||||
if (IsStackTraceHidden(method))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StackTraceHiddenAttibuteType != null)
|
||||
if (StackTraceHiddenAttributeType != null)
|
||||
{
|
||||
// Don't show any types marked with the StackTraceHiddenAttribute
|
||||
// https://github.com/dotnet/coreclr/pull/14652
|
||||
@ -710,7 +712,7 @@ namespace System.Diagnostics
|
||||
{
|
||||
if (!memberInfo.Module.Assembly.ReflectionOnly)
|
||||
{
|
||||
return memberInfo.GetCustomAttributes(StackTraceHiddenAttibuteType, false).Length != 0;
|
||||
return memberInfo.GetCustomAttributes(StackTraceHiddenAttributeType, false).Length != 0;
|
||||
}
|
||||
|
||||
EnumerableIList<CustomAttributeData> attributes;
|
||||
@ -726,7 +728,7 @@ namespace System.Diagnostics
|
||||
foreach (var attribute in attributes)
|
||||
{
|
||||
// reflection-only attribute, match on name
|
||||
if (attribute.AttributeType.FullName == StackTraceHiddenAttibuteType.FullName)
|
||||
if (attribute.AttributeType.FullName == StackTraceHiddenAttributeType.FullName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user