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

Unified Diff: pkg/compiler/lib/src/diagnostics/invariant.dart

Issue 1520293002: Add token invariant to DiagnosticReporter (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rebase + status update Created 5 years 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/diagnostics/invariant.dart
diff --git a/pkg/compiler/lib/src/diagnostics/invariant.dart b/pkg/compiler/lib/src/diagnostics/invariant.dart
index b6d4d0faf09252cb99916a56392cd9555a1de8fc..349d89baf8bb377f62cc1cd162d578ab20400ed0 100644
--- a/pkg/compiler/lib/src/diagnostics/invariant.dart
+++ b/pkg/compiler/lib/src/diagnostics/invariant.dart
@@ -48,6 +48,10 @@ bool invariant(Spannable spannable, var condition, {var message: null}) {
}
if (condition is Function){
condition = condition();
+ if (condition is String) {
+ message = condition;
+ condition = false;
+ }
}
if (!condition) {
if (message is Function) {
« no previous file with comments | « pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698