Index: pkg/compiler/lib/src/dart_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart |
index 2f81597fbc8575a2b4c9a7e34439b4432da2abac..c2057a711413413b0db3a5bcb49a2465657edab9 100644 |
--- a/pkg/compiler/lib/src/dart_backend/backend.dart |
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart |
@@ -52,7 +52,7 @@ class DartBackend extends Backend { |
new Set<ClassElement>(); |
bool enableCodegenWithErrorsIfSupported(Spannable node) { |
- compiler.reportHintMessage( |
+ reporter.reportHintMessage( |
node, |
MessageKind.GENERIC, |
{'text': "Generation of code with compile time errors is not " |
@@ -108,7 +108,7 @@ class DartBackend extends Backend { |
stripAsserts = strips.indexOf('asserts') != -1, |
constantCompilerTask = new DartConstantTask(compiler), |
outputter = new DartOutputter( |
- compiler, compiler.outputProvider, |
+ compiler.reporter, compiler.outputProvider, |
forceStripTypes: strips.indexOf('types') != -1, |
multiFile: multiFile, |
enableMinification: compiler.enableMinification), |
@@ -116,6 +116,9 @@ class DartBackend extends Backend { |
resolutionCallbacks = new DartResolutionCallbacks(this); |
} |
+ |
+ DiagnosticReporter get reporter => compiler.reporter; |
+ |
Resolution get resolution => compiler.resolution; |
bool classNeedsRti(ClassElement cls) => false; |
@@ -169,7 +172,7 @@ class DartBackend extends Backend { |
newTypedefElementCallback, |
newClassElementCallback) { |
ReferencedElementCollector collector = |
- new ReferencedElementCollector(compiler, |
+ new ReferencedElementCollector(reporter, |
element, |
elementAst, |
newTypedefElementCallback, |
@@ -216,7 +219,7 @@ class DartBackend extends Backend { |
'Output total size: $totalOutputSize bytes (${percentage}%)'); |
} |
- log(String message) => compiler.log('[DartBackend] $message'); |
+ log(String message) => reporter.log('[DartBackend] $message'); |
@override |
Future onLibrariesLoaded(LoadedLibraries loadedLibraries) { |
@@ -332,7 +335,7 @@ class DartBackend extends Backend { |
@override |
bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) { |
// TODO(sigurdm): Implement deferred loading for dart2dart. |
- compiler.reportWarningMessage( |
+ reporter.reportWarningMessage( |
node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); |
return false; |
} |
@@ -387,13 +390,13 @@ class EmitterUnparser extends Unparser { |
* (just to name a few). Retraverse AST to pick those up. |
*/ |
class ReferencedElementCollector extends Visitor { |
- final Compiler compiler; |
+ final DiagnosticReporter reporter; |
final Element element; |
final ElementAst elementAst; |
final newTypedefElementCallback; |
final newClassElementCallback; |
- ReferencedElementCollector(this.compiler, |
+ ReferencedElementCollector(this.reporter, |
this.element, |
this.elementAst, |
this.newTypedefElementCallback, |
@@ -414,7 +417,7 @@ class ReferencedElementCollector extends Visitor { |
} |
void collect() { |
- compiler.withCurrentElement(element, () { |
+ reporter.withCurrentElement(element, () { |
elementAst.ast.accept(this); |
}); |
} |