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

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

Issue 2706053002: Implement --fatal=errors. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..06f217e26ac339b250e4f6e1f323248ffa9e3c4d 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 errorsAreFatal => CompilerContext.current.options.errorsAreFatal;
+
+bool get nitsAreFatal => CompilerContext.current.options.nitsAreFatal;
+
+bool get warningsAreFatal => CompilerContext.current.options.warningsAreFatal;
+
+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 (warningsAreFatal) {
+ 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 (nitsAreFatal) {
+ if (isVerbose) print(StackTrace.current);
throw new InputError(
uri, charOffset, "Compilation aborted due to fatal nits.");
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698