Cosmos/source/Cosmos.IL2CPU/ExceptionHelper.cs
José Pedro 39ea6ee678 Fixed return on foreach
Fixed Array.Clear
Minor changes
2016-11-09 00:08:23 +00:00

28 lines
773 B
C#

using System;
using FieldInfo = System.Reflection.FieldInfo;
namespace Cosmos.IL2CPU {
public static class ExceptionHelper {
public static Exception CurrentException;
public static void ThrowNotImplemented(string aError) {
Console.WriteLine(aError);
throw new NotImplementedException(aError);
}
public static void ThrowOverflow() {
string xError = "Arithmetic operation gets an overflow!";
Console.WriteLine(xError);
throw new OverflowException(xError);
}
}
public static class ExceptionHelperRefs
{
public static readonly FieldInfo CurrentExceptionRef;
static ExceptionHelperRefs() {
CurrentExceptionRef = typeof(ExceptionHelper).GetField("CurrentException");
}
}
}