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

Unified Diff: pkg/front_end/lib/src/fasta/messages.dart

Issue 2706053002: Implement --fatal=errors. (Closed)
Patch Set: Created 3 years, 10 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/front_end/lib/src/fasta/messages.dart
diff --git a/pkg/front_end/lib/src/fasta/messages.dart b/pkg/front_end/lib/src/fasta/messages.dart
index a4e4939fd401865d9ea6f321bd02275245977b83..e6a65908e893be5bef1f14df7715b85aba58931c 100644
--- a/pkg/front_end/lib/src/fasta/messages.dart
+++ b/pkg/front_end/lib/src/fasta/messages.dart
@@ -25,11 +25,19 @@ const bool hideNits = false;
const bool hideWarnings = false;
+bool get areErrorsFatal => CompilerContext.current.options.areErrorsFatal;
+
+bool get areNitsFatal => CompilerContext.current.options.areNitsFatal;
+
+bool get areWarningsFatal => CompilerContext.current.options.areWarningsFatal;
+
+bool get isVerbose => CompilerContext.current.options.verbose;
+
void warning(Uri uri, int charOffset, String message) {
if (hideWarnings) return;
print(format(uri, charOffset, colorWarning("Warning: $message")));
- if (CompilerContext.current.options.areWarningsFatal) {
- if (CompilerContext.current.options.verbose) print(StackTrace.current);
+ if (areWarningsFatal) {
+ if (isVerbose) print(StackTrace.current);
throw new InputError(
uri, charOffset, "Compilation aborted due to fatal warnings.");
}
@@ -38,8 +46,8 @@ void warning(Uri uri, int charOffset, String message) {
void nit(Uri uri, int charOffset, String message) {
if (hideNits) return;
print(format(uri, charOffset, colorNit("Nit: $message")));
- if (CompilerContext.current.options.areNitsFatal) {
- if (CompilerContext.current.options.verbose) print(StackTrace.current);
+ if (areNitsFatal) {
+ if (isVerbose) print(StackTrace.current);
throw new InputError(
uri, charOffset, "Compilation aborted due to fatal nits.");
}

Powered by Google App Engine
This is Rietveld 408576698