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

Unified Diff: tests/compiler/dart2js/diagnostic_reporter_helper.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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 | « tests/compiler/dart2js/compiler_test.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/diagnostic_reporter_helper.dart
diff --git a/tests/compiler/dart2js/diagnostic_reporter_helper.dart b/tests/compiler/dart2js/diagnostic_reporter_helper.dart
new file mode 100644
index 0000000000000000000000000000000000000000..0bff79516ae77b82d01ce11571632495855a1518
--- /dev/null
+++ b/tests/compiler/dart2js/diagnostic_reporter_helper.dart
@@ -0,0 +1,75 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.diagnostic_reporter.helper;
+
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/diagnostics/spannable.dart';
+import 'package:compiler/src/diagnostics/source_span.dart';
+import 'package:compiler/src/elements/elements.dart';
+
+abstract class DiagnosticReporterWrapper extends DiagnosticReporter {
+ DiagnosticReporter get reporter;
+
+ @override
+ DiagnosticMessage createMessage(
+ Spannable spannable,
+ MessageKind messageKind,
+ [Map arguments = const {}]) {
+ return reporter.createMessage(spannable, messageKind, arguments);
+ }
+
+ @override
+ internalError(Spannable spannable, message) {
+ return reporter.internalError(spannable, message);
+ }
+
+ @override
+ void log(message) {
+ return reporter.log(message);
+ }
+
+ @override
+ DiagnosticOptions get options => reporter.options;
+
+ @override
+ void reportError(
+ DiagnosticMessage message,
+ [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+ reporter.reportError(message, infos);
+ }
+
+ @override
+ void reportHint(
+ DiagnosticMessage message,
+ [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+ reporter.reportHint(message, infos);
+ }
+
+ @override
+ void reportInfo(
+ Spannable node,
+ MessageKind errorCode,
+ [Map arguments = const {}]) {
+ reporter.reportInfo(node, errorCode, arguments);
+ }
+
+ @override
+ void reportWarning(
+ DiagnosticMessage message,
+ [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+ reporter.reportWarning(message, infos);
+ }
+
+ @override
+ SourceSpan spanFromSpannable(Spannable node) {
+ return reporter.spanFromSpannable(node);
+ }
+
+ @override
+ withCurrentElement(Element element, f()) {
+ return reporter.withCurrentElement(element, f);
+ }
+}
« no previous file with comments | « tests/compiler/dart2js/compiler_test.dart ('k') | tests/compiler/dart2js/exit_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698