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

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

Issue 1342213003: Add optional message to assert in Dart2js - continued (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add --assert-message flag Created 5 years, 3 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/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index 8fabdf8e91de92285ee11fdaf233fa78b8fb7efa..f2911585d5b3067de168eb7006480f1acecf7b6a 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -188,6 +188,7 @@ enum MessageKind {
EXISTING_DEFINITION,
EXISTING_LABEL,
EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
+ EXPERIMENTAL_ASSERT_MESSAGE,
EXPONENT_MISSING,
EXPORT_BEFORE_PARTS,
EXTERNAL_WITH_BODY,
@@ -3269,6 +3270,19 @@ main() => foo();
// Patch errors end.
//////////////////////////////////////////////////////////////////////////////
+ MessageKind.EXPERIMENTAL_ASSERT_MESSAGE:
+ const MessageTemplate(MessageKind.EXPERIMENTAL_ASSERT_MESSAGE,
+ "Experimental language feature 'assertion with message'"
+ " is not supported.",
+ howToFix:
+ "Use option '--assert-message' to use assertions with messages.",
+ examples: const [r'''
+main() {
+ int n = -7;
+ assert(n > 0, 'must be positive: $n');
+}
+''']),
+
MessageKind.IMPORT_EXPERIMENTAL_MIRRORS:
const MessageTemplate(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, r'''
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/placeholder_collector.dart ('k') | pkg/compiler/lib/src/inferrer/inferrer_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698