Index: pkg/compiler/lib/src/helpers/trace.dart |
diff --git a/pkg/compiler/lib/src/helpers/trace.dart b/pkg/compiler/lib/src/helpers/trace.dart |
index 021ba97fd92e01bb96972ed913243e42df47960d..389f5c8c9ecd3c51b851b4bee2f01adfdc850b7e 100644 |
--- a/pkg/compiler/lib/src/helpers/trace.dart |
+++ b/pkg/compiler/lib/src/helpers/trace.dart |
@@ -5,10 +5,6 @@ |
import '../common.dart'; |
import '../util/util.dart'; |
-/// Function signature for [trace]. |
-typedef void Trace(String message, |
- {bool condition(String stackTrace), int limit, bool throwOnPrint}); |
- |
/** |
* Helper method for printing stack traces for debugging. |
* |
@@ -26,13 +22,16 @@ typedef void Trace(String message, |
* unknown call-sites in tests by filtering known call-sites and throwning |
* otherwise. |
*/ |
-Trace get trace { |
+void Function(String message, {bool Function(String stackTrace) condition, int limit, |
+ bool throwOnPrint}) |
+get trace { |
enableDebugMode(); |
return _trace; |
} |
void _trace(String message, |
- {bool condition(String stackTrace), int limit, bool throwOnPrint: false}) { |
+ {bool Function(String stackTrace) condition, int limit, |
+ bool throwOnPrint: false}) { |
try { |
throw ''; |
} catch (e, s) { |
@@ -59,9 +58,10 @@ traceExceptions(List<String> exceptions) { |
} |
/// Function signature of [traceAndReport]. |
-typedef void TraceAndReport( |
- DiagnosticReporter reporter, Spannable node, String message, |
- {bool condition(String stackTrace), int limit, bool throwOnPrint}); |
+typedef TraceAndReport = void Function( |
+ DiagnosticReporter, Spannable node, String message, |
+ {bool Function(String stackTrace) condition, int limit, bool throwOnPrint}) |
+ |
/// Calls [reportHere] and [trace] with the same message. |
TraceAndReport get traceAndReport { |
@@ -75,7 +75,8 @@ TraceAndReport get reportAndTrace => traceAndReport; |
/// Implementation of [traceAndReport]. |
void _traceAndReport( |
DiagnosticReporter reporter, Spannable node, String message, |
- {bool condition(String stackTrace), int limit, bool throwOnPrint: false}) { |
+ {bool Function(String stackTrace) condition, int limit, |
+ bool throwOnPrint: false}) { |
trace(message, limit: limit, throwOnPrint: throwOnPrint, |
condition: (String stackTrace) { |
bool result = condition != null ? condition(stackTrace) : true; |