| 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..75b7baeaf32a25f2a0598f58d99c49009279a7e5 100644
|
| --- a/pkg/front_end/lib/src/fasta/command_line_reporting.dart
|
| +++ b/pkg/front_end/lib/src/fasta/command_line_reporting.dart
|
| @@ -97,21 +97,21 @@ 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;
|
| + return CompilerContext.current.options.throwOnErrorsForDebugging;
|
|
|
| case Severity.internalProblem:
|
| return true;
|
|
|
| case Severity.nit:
|
| - return CompilerContext.current.options.throwOnNits;
|
| + return CompilerContext.current.options.throwOnNitsForDebugging;
|
|
|
| case Severity.warning:
|
| - return CompilerContext.current.options.throwOnWarnings;
|
| + return CompilerContext.current.options.throwOnWarningsForDebugging;
|
| }
|
| - 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(
|
| 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);
|
| }
|
|
|
|
|