| 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) {
|
|
|