Index: pkg/front_end/lib/src/fasta/command_line_reporting.dart |
diff --git a/pkg/front_end/lib/src/fasta/command_line_reporting.dart b/pkg/front_end/lib/src/fasta/command_line_reporting.dart |
index 07f2b6d744231ff71f465836eeb451d965c28a95..16e5ec2f86a4b35435593eb5c0c9370b67e495ed 100644 |
--- a/pkg/front_end/lib/src/fasta/command_line_reporting.dart |
+++ b/pkg/front_end/lib/src/fasta/command_line_reporting.dart |
@@ -97,7 +97,7 @@ bool isHidden(Severity severity) { |
/// Are problems of [severity] fatal? That is, should the compiler terminate |
/// immediately? |
-bool isFatal(Severity severity) { |
+bool shouldThrowOn(Severity severity) { |
switch (severity) { |
case Severity.error: |
return CompilerContext.current.options.throwOnErrors; |
@@ -111,7 +111,7 @@ bool isFatal(Severity severity) { |
case Severity.warning: |
return CompilerContext.current.options.throwOnWarnings; |
} |
- return unhandled("$severity", "isFatal", -1, null); |
+ return unhandled("$severity", "shouldThrowOn", -1, null); |
} |
/// Convert [severity] to a name that can be used to prefix a message. |
@@ -135,7 +135,7 @@ String severityName(Severity severity, {bool capitalized: false}) { |
/// Print a formatted message and throw when errors are treated as fatal. |
/// Also set [exitCode] depending on the value of |
/// `CompilerContext.current.options.setExitCodeOnProblem`. |
-void _printAndThrowIfFatal( |
+void _printAndThrowIfDebugging( |
Siggi Cherem (dart-lang)
2017/08/23 20:17:34
I do like these renames - just want to make sure w
ahe
2017/08/24 11:52:01
I don't think we agree on what the default should
|
String text, Severity severity, Uri uri, int charOffset) { |
// I believe we should only set it if we are reporting something, if we are |
// formatting to embed the error in the program, then we probably don't want |
@@ -147,7 +147,7 @@ void _printAndThrowIfFatal( |
exitCode = 1; |
} |
print(text); |
- if (isFatal(severity)) { |
+ if (shouldThrowOn(severity)) { |
if (isVerbose) print(StackTrace.current); |
// TODO(sigmund,ahe): ensure there is no circularity when InputError is |
// handled. |
@@ -163,7 +163,7 @@ void _printAndThrowIfFatal( |
/// [CompilerContext.report] instead. |
void report(LocatedMessage message, Severity severity) { |
if (isHidden(severity)) return; |
- _printAndThrowIfFatal( |
+ _printAndThrowIfDebugging( |
format(message, severity), severity, message.uri, message.charOffset); |
} |
@@ -173,7 +173,7 @@ void report(LocatedMessage message, Severity severity) { |
/// [CompilerContext.reportWithoutLocation] instead. |
void reportWithoutLocation(Message message, Severity severity) { |
if (isHidden(severity)) return; |
- _printAndThrowIfFatal( |
+ _printAndThrowIfDebugging( |
formatWithoutLocation(message, severity), severity, null, -1); |
} |