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

Unified Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 3005973002: Fix and triage more tests (Closed)
Patch Set: address comments Created 3 years, 3 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 | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/fasta/ast_builder.dart
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 8396f26ca1f006fdb6d0a3b7f023c1b172f09a74..183f3c19cc22e49f167f2dff0f4d54490f5b38e1 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -71,6 +71,12 @@ class AstBuilder extends ScopeListener {
// * The current library has an import that uses the scheme "dart-ext".
bool allowNativeClause = false;
+ /// A flag indicating whether an exception should be thrown when an error is
+ /// reported for which we have no mapping into an analyzer error.
+ //
+ // TODO(brianwilkerson) Remove this flag after failing tests have been triaged.
+ bool throwOnMissingErrorMapping = true;
+
AstBuilder(this.errorReporter, this.library, this.member, Scope scope,
this.isFullAst,
[Uri uri])
@@ -1081,7 +1087,9 @@ class AstBuilder extends ScopeListener {
return token;
}
}
- return super.handleUnrecoverableError(token, message);
+ if (throwOnMissingErrorMapping) {
+ throw new UnimplementedError('Failed to map $message at $token');
+ }
}
void handleUnaryPrefixExpression(Token token) {
@@ -1956,7 +1964,9 @@ class AstBuilder extends ScopeListener {
default:
// fall through
}
- library.addCompileTimeError(message, charOffset, uri);
+ if (throwOnMissingErrorMapping) {
+ throw new UnimplementedError('Failed to map $message at $charOffset');
+ }
}
/// A marker method used to mark locations where a token is being located in
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_fasta_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698