浏览代码

typo fix + remove ReportError

/main
xingwei.zhu 6 年前
当前提交
c3c0e4a2
共有 2 个文件被更改,包括 10 次插入23 次删除
  1. 27
      Runtime/foundation/debug.cs
  2. 6
      Runtime/widgets/app.cs

27
Runtime/foundation/debug.cs


public static class D {
public static void logError(string message, Exception ex = null) {
Debug.LogException(new ReportError(message, ex));
Debug.LogException(new AssertionError(message, ex));
}
[Conditional("UIWidgets_DEBUG")]
public static void assert(Func<bool> result, string message = null) {

[Serializable]
public class AssertionError : Exception {
readonly Exception innerException;
public override string StackTrace {
get {
var stackTrace = base.StackTrace;
var lines = stackTrace.Split('\n');
var strippedLines = lines.Skip(1);
return string.Join("\n", strippedLines);
}
}
}
public class ReportError : Exception {
Exception ex;
public ReportError(string message, Exception ex = null) : base(message) {
this.ex = ex;
public AssertionError(string message, Exception innerException = null) : base(message) {
this.innerException = innerException;
if (this.ex != null) {
return this.ex.StackTrace;
if (this.innerException != null) {
return this.innerException.StackTrace;
}
var stackTrace = base.StackTrace;

return string.Join("\n", strippedLines);
}
}
}
}

6
Runtime/widgets/app.cs


public readonly Dictionary<string, WidgetBuilder> routes;
public readonly TextStyle textStyle;
public readonly Window window;
public readonly bool showPerformanceoverlay;
public readonly bool showPerformanceOverlay;
public readonly Locale locale;
public readonly List<LocalizationsDelegate> localizationsDelegates;
public readonly LocaleListResolutionCallback localeListResolutionCallback;

this.localeListResolutionCallback = localeListResolutionCallback;
this.localeResolutionCallback = localeResolutionCallback;
this.supportedLocales = supportedLocales;
this.showPerformanceoverlay = showPerformanceOverlay;
this.showPerformanceOverlay = showPerformanceOverlay;
D.assert(
home == null ||

}
PerformanceOverlay performanceOverlay = null;
if (this.widget.showPerformanceoverlay) {
if (this.widget.showPerformanceOverlay) {
performanceOverlay = PerformanceOverlay.allEnabled();
}

正在加载...
取消
保存