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

Unified Diff: dart/pkg/compiler/lib/src/scanner/listener.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
Index: dart/pkg/compiler/lib/src/scanner/listener.dart
diff --git a/dart/pkg/compiler/lib/src/scanner/listener.dart b/dart/pkg/compiler/lib/src/scanner/listener.dart
index 887232e5ae15de41569f8a2f6861b1b74349f1cd..338b5dc914a147828e7cb5fcd117be9eca3ffeff 100644
--- a/dart/pkg/compiler/lib/src/scanner/listener.dart
+++ b/dart/pkg/compiler/lib/src/scanner/listener.dart
@@ -1463,10 +1463,15 @@ class ElementListener extends Listener {
memberErrors = memberErrors.tail;
}
+ /// Don't call this method. Should only be used as a last resort when there
+ /// is no feasible way to recover from a parser error.
void reportFatalError(Spannable spannable,
String message) {
- listener.reportFatalError(
+ listener.reportError(
spannable, MessageKind.GENERIC, {'text': message});
+ // Some parse errors are infeasible to recover from, so we abort
+ // compilation instead.
+ throw new CompilerCancelledException(message);
}
void reportError(Spannable spannable,
@@ -1490,6 +1495,8 @@ class NodeListener extends ElementListener {
{bool this.throwOnFatalError: false})
: super(listener, element, null);
+ /// Don't call this method. Should only be used as a last resort when there
+ /// is no feasible way to recover from a parser error.
void reportFatalError(Spannable spannable,
String message) {
if (throwOnFatalError) {
« no previous file with comments | « dart/pkg/compiler/lib/src/resolution/signatures.dart ('k') | dart/pkg/compiler/lib/src/string_validator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698