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

Unified Diff: dart/pkg/compiler/lib/src/compiler.dart

Issue 791263003: Remove Compiler.reportFatalError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Restore code I accidentally removed. Created 5 years, 11 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 | « dart/pkg/compiler/lib/src/compile_time_constants.dart ('k') | dart/pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/compiler.dart
diff --git a/dart/pkg/compiler/lib/src/compiler.dart b/dart/pkg/compiler/lib/src/compiler.dart
index 673fa5ba79aac85fd2d5d9284b569acc53350f70..935f2a0b8d03946274654dac9ce35233c6fc90fd 100644
--- a/dart/pkg/compiler/lib/src/compiler.dart
+++ b/dart/pkg/compiler/lib/src/compiler.dart
@@ -1792,34 +1792,6 @@ abstract class Compiler implements DiagnosticListener {
node, messageKind, arguments, api.Diagnostic.ERROR);
}
- /**
- * Reports an error and then aborts the compiler. Avoid using this method.
- *
- * In order to support incremental compilation, it is preferable to use
- * [reportError]. However, care must be taken to leave the compiler in a
- * consistent state, for example, by creating synthetic erroneous objects.
- *
- * If there's absolutely no way to leave the compiler in a consistent state,
- * calling this method is preferred as it will set [compilerWasCancelled] to
- * true which alerts the incremental compiler to discard all state and start
- * a new compiler. Throwing an exception is also better, as this will set
- * [hasCrashed] which the incremental compiler also listens too (but don't
- * throw exceptions, it creates a really bad user experience).
- *
- * In any case, calling this method is a last resort, as it essentially
- * breaks the user experience of the incremental compiler. The purpose of the
- * incremental compiler is to improve developer productivity. Developers
- * frequently make mistakes, so syntax errors and spelling errors are
- * considered normal to the incremental compiler.
- */
- void reportFatalError(Spannable node, MessageKind messageKind,
- [Map arguments = const {}]) {
- reportError(node, messageKind, arguments);
- // TODO(ahe): Make this only abort the current method.
- throw new CompilerCancelledException(
- 'Error: Cannot continue due to previous error.');
- }
-
void reportWarning(Spannable node, MessageKind messageKind,
[Map arguments = const {}]) {
reportDiagnosticInternal(
@@ -2159,7 +2131,12 @@ class CompilerTask {
}
}
-class CompilerCancelledException implements Exception {
+/// Don't throw this error. It immediately aborts the compiler which causes the
+/// following problems:
+///
+/// 1. No further errors and warnings are reported.
+/// 2. Breaks incremental compilation.
+class CompilerCancelledException extends Error {
final String reason;
CompilerCancelledException(this.reason);
« no previous file with comments | « dart/pkg/compiler/lib/src/compile_time_constants.dart ('k') | dart/pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698