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 5f3f7675370c1275bfff116bfe65e58df400d0d9..7224d978247272a868da5c5baffa89d8af592266 100644 |
--- a/pkg/front_end/lib/src/fasta/messages.dart |
+++ b/pkg/front_end/lib/src/fasta/messages.dart |
@@ -4,6 +4,8 @@ |
library fasta.messages; |
+import 'dart:io' show exitCode; |
+ |
import 'package:kernel/ast.dart' show Library, Location, Program, TreeNode; |
import 'util/relativize.dart' show relativizeUri; |
@@ -30,6 +32,10 @@ bool get isVerbose => CompilerContext.current.options.verbose; |
bool get hideNits => !isVerbose; |
+bool get setExitCodeOnProblem { |
+ return CompilerContext.current.options.setExitCodeOnProblem; |
+} |
+ |
void warning(Message message, int charOffset, Uri uri) { |
if (hideWarnings) return; |
print(deprecated_format( |
@@ -85,6 +91,9 @@ String colorNit(String message) { |
} |
String deprecated_format(Uri uri, int charOffset, String message) { |
+ if (setExitCodeOnProblem) { |
Siggi Cherem (dart-lang)
2017/07/11 17:04:16
just to make sure, we would practically only get h
ahe
2017/07/11 17:52:36
No. We get here if we print any diagnostic. But I
Siggi Cherem (dart-lang)
2017/07/11 18:12:34
OK - so it is done only if something is visible in
ahe
2017/07/12 09:59:06
I have already implemented this, and should be abl
|
+ exitCode = 1; |
+ } |
if (uri != null) { |
String path = relativizeUri(uri); |
Location location = charOffset == -1 ? null : getLocation(path, charOffset); |