Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(314)

Unified Diff: pkg/compiler/lib/src/helpers/helpers.dart

Issue 2439573003: Experiment with new function-type syntax.
Patch Set: Change a few more typedefs. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/helpers/helpers.dart
diff --git a/pkg/compiler/lib/src/helpers/helpers.dart b/pkg/compiler/lib/src/helpers/helpers.dart
index 14a788708236cd8b858d9f4cfd6f81b4f1160d6a..c7c626775438036e4907ff45b48748e5aba9e2fe 100644
--- a/pkg/compiler/lib/src/helpers/helpers.dart
+++ b/pkg/compiler/lib/src/helpers/helpers.dart
@@ -37,29 +37,23 @@ class _DebugIndentation extends Indentation {
_DebugIndentation _indentation = new _DebugIndentation();
-/// Function signature of [debugPrint].
-typedef DebugPrint(s);
-
/// If [DEBUG_PRINT_ENABLED] is `true` print [s] using the current identation.
-DebugPrint get debugPrint {
+(dynamic s) -> void get debugPrint {
enableDebugMode();
// TODO(johnniwinther): Maybe disable debug mode after the call.
return _debugPrint;
}
/// Implementation of [debugPrint].
-_debugPrint(s) {
+void _debugPrint(s) {
if (DEBUG_PRINT_ENABLED) print('${_indentation.indentation}$s');
}
-/// Function signature of [debugWrapPrint].
-typedef DebugWrapPrint(s, f());
-
/// Wraps the call to [f] with a print of 'start:$s' and 'end:$s' incrementing
/// the current indentation used by [debugPrint] during the execution of [f].
///
/// Use this to get a tree-like debug printout for nested calls.
-DebugWrapPrint get debugWrapPrint {
+(dynamic s, ()->dynamic f) -> dynamic get debugWrapPrint {
enableDebugMode();
return _debugWrapPrint;
}
@@ -82,7 +76,8 @@ typedef ReportHere(
DiagnosticReporter reporter, Spannable node, String debugMessage);
/// Print a message with a source location.
-ReportHere get reportHere {
+(DiagnosticReporter, Spannable node, String debugMessage) -> dynamic
+ get reportHere {
enableDebugMode();
return _reportHere;
}

Powered by Google App Engine
This is Rietveld 408576698