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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart

Issue 18125004: Don't request bug reports when aborting due to --throw-on-error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | « no previous file | dart/sdk/lib/_internal/compiler/implementation/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
index abb492c7d4fa80274a3e7047fad46981b241b8d8..dc4d63740042c71faf28df038a19a805c78c4ce8 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/apiimpl.dart
@@ -22,6 +22,7 @@ class Compiler extends leg.Compiler {
List<String> options;
bool mockableLibraryUsed = false;
final Set<String> allowedLibraryCategories;
+ final bool throwOnError;
Compiler(this.provider,
api.CompilerOutputProvider outputProvider,
@@ -31,6 +32,7 @@ class Compiler extends leg.Compiler {
List<String> options)
: this.options = options,
this.allowedLibraryCategories = getAllowedLibraryCategories(options),
+ this.throwOnError = hasOption(options, '--throw-on-error'),
super(
tracer: new ssa.HTracer(
ssa.GENERATE_SSA_TRACE ? outputProvider('dart', 'cfg') : null),
@@ -273,9 +275,11 @@ class Compiler extends leg.Compiler {
void reportDiagnostic(leg.SourceSpan span, String message,
api.Diagnostic kind) {
+ bool isFatal = false;
if (identical(kind, api.Diagnostic.ERROR)
|| identical(kind, api.Diagnostic.CRASH)) {
compilationFailed = true;
+ isFatal = true;
}
// [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
// instance in the [Types] constructor in typechecker.dart.
@@ -285,6 +289,10 @@ class Compiler extends leg.Compiler {
handler(translateUri(span.uri, null), span.begin, span.end,
message, kind);
}
+ if (isFatal && throwOnError) {
+ hasCrashed = true;
kasperl 2013/06/28 10:26:50 Add a comment here? Rename flag to make it clear t
+ throw new AbortCompilation(message);
+ }
}
bool get isMockCompilation {
@@ -292,3 +300,9 @@ class Compiler extends leg.Compiler {
&& (options.indexOf('--allow-mock-compilation') != -1);
}
}
+
+class AbortCompilation {
+ final message;
+ AbortCompilation(this.message);
+ toString() => 'Aborted due to --throw-on-error: $message';
+}
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698