Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/NUnitLite.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Pouliot <sebastien@xamarin.com>2013-09-04 16:33:39 +0400
committerSebastien Pouliot <sebastien@xamarin.com>2013-09-04 16:33:39 +0400
commit097a333cd590e9f45c9f40d53fbb72e94b0a3e61 (patch)
treebef6ef8b2edda0507761ba5b645d55566a904439
parenta4f678fc72876d03cd7054ec0bcf8485531b8053 (diff)
Exception.InternalPreserveStackTrace is not something available in Monopre-1.0
-rwxr-xr-xNUnitLite-0.9.0/src/framework/Internal/AsyncInvocationRegion.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/NUnitLite-0.9.0/src/framework/Internal/AsyncInvocationRegion.cs b/NUnitLite-0.9.0/src/framework/Internal/AsyncInvocationRegion.cs
index 345a808..c37a6d5 100755
--- a/NUnitLite-0.9.0/src/framework/Internal/AsyncInvocationRegion.cs
+++ b/NUnitLite-0.9.0/src/framework/Internal/AsyncInvocationRegion.cs
@@ -9,12 +9,16 @@ namespace NUnit.Framework.Internal
internal abstract class AsyncInvocationRegion : IDisposable
{
private static readonly Type AsyncStateMachineAttribute = Type.GetType("System.Runtime.CompilerServices.AsyncStateMachineAttribute");
+#if !MONOTOUCH
private static readonly MethodInfo PreserveStackTraceMethod = typeof(Exception).GetMethod("InternalPreserveStackTrace", BindingFlags.Instance | BindingFlags.NonPublic);
+#endif
private static readonly Action<Exception> PreserveStackTrace;
static AsyncInvocationRegion()
{
+#if !MONOTOUCH
PreserveStackTrace = (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), PreserveStackTraceMethod);
+#endif
}
private AsyncInvocationRegion()
@@ -85,7 +89,8 @@ at wrapping a non-async method invocation in an async region was done");
}
catch (Exception e)
{
- PreserveStackTrace(e);
+ if (PreserveStackTrace != null)
+ PreserveStackTrace(e);
throw;
}
}
@@ -109,7 +114,8 @@ at wrapping a non-async method invocation in an async region was done");
{
IList<Exception> innerExceptions = GetAllExceptions(e.InnerException);
- PreserveStackTrace(innerExceptions[0]);
+ if (PreserveStackTrace != null)
+ PreserveStackTrace(innerExceptions[0]);
throw innerExceptions[0];
}