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

Unified Diff: pkg/front_end/lib/src/fasta/problems.dart

Issue 2977013002: Report messages instead of just printing. (Closed)
Patch Set: Update expectations. Created 3 years, 5 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: pkg/front_end/lib/src/fasta/problems.dart
diff --git a/pkg/front_end/lib/src/fasta/problems.dart b/pkg/front_end/lib/src/fasta/problems.dart
index 26b34233ece93de135e939555334b525553d8d5d..a9105f54fd8234c802cc13c0653ff7486f3a7375 100644
--- a/pkg/front_end/lib/src/fasta/problems.dart
+++ b/pkg/front_end/lib/src/fasta/problems.dart
@@ -4,15 +4,18 @@
library fasta.problems;
+import 'compiler_context.dart' show CompilerContext;
+
import 'messages.dart'
show
Message,
- deprecated_format,
templateInternalProblemUnexpected,
templateInternalProblemUnhandled,
templateInternalProblemUnimplemented,
templateInternalProblemUnsupported;
+import 'severity.dart' show Severity;
+
/// Used to report an internal error.
///
/// Internal errors should be avoided as best as possible, but are preferred
@@ -23,15 +26,8 @@ import 'messages.dart'
///
/// Before printing the message, the string `"Internal error: "` is prepended.
dynamic internalProblem(Message message, int charOffset, Uri uri) {
- String text = "Internal error: ${message.message}";
- if (message.tip != null) {
- text += "\n${message.tip}";
- }
- if (uri == null && charOffset == -1) {
- throw text;
- } else {
- throw deprecated_format(uri, charOffset, text);
- }
+ throw CompilerContext.current
+ .format(message.withLocation(uri, charOffset), Severity.internalProblem);
}
dynamic unimplemented(String what, [int charOffset = -1, Uri uri = null]) {

Powered by Google App Engine
This is Rietveld 408576698