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

Unified Diff: pkg/compiler/lib/src/closure.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 | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/common/resolution.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 63c15f1e92d07ff8b3e313423bbf25f7a244f5a0..a65a2b043da3d7e9fa2279471a6830795185bc30 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -78,7 +78,7 @@ class ClosureTask extends CompilerTask {
return measure(() {
ClosureClassMap nestedClosureData = closureMappingCache[node];
if (nestedClosureData == null) {
- compiler.internalError(node, "No closure cache.");
+ reporter.internalError(node, "No closure cache.");
}
return nestedClosureData;
});
@@ -211,7 +211,7 @@ class ClosureClassElement extends ClassElementX {
Iterable<ClosureFieldElement> get closureFields => _closureFields;
- void addField(ClosureFieldElement field, DiagnosticListener listener) {
+ void addField(ClosureFieldElement field, DiagnosticReporter listener) {
_closureFields.add(field);
addMember(field, listener);
}
@@ -510,6 +510,8 @@ class ClosureTranslator extends Visitor {
this.elements,
this.closureMappingCache);
+ DiagnosticReporter get reporter => compiler.reporter;
+
/// Generate a unique name for the [id]th closure field, with proposed name
/// [name].
///
@@ -542,7 +544,7 @@ class ClosureTranslator extends Visitor {
void addCapturedVariable(Node node, Local variable) {
if (_capturedVariableMapping[variable] != null) {
- compiler.internalError(node, 'In closure analyzer.');
+ reporter.internalError(node, 'In closure analyzer.');
}
_capturedVariableMapping[variable] = null;
}
@@ -612,7 +614,7 @@ class ClosureTranslator extends Visitor {
void addClosureField(Local local, String name) {
ClosureFieldElement closureField =
new ClosureFieldElement(name, local, closureClass);
- closureClass.addField(closureField, compiler);
+ closureClass.addField(closureField, reporter);
data.freeVariableMap[local] = closureField;
}
@@ -1002,7 +1004,7 @@ class ClosureTranslator extends Visitor {
globalizedElement, callElement, element);
MemberElement enclosing = element.memberContext;
enclosing.nestedClosures.add(callElement);
- globalizedElement.addMember(callElement, compiler);
+ globalizedElement.addMember(callElement, reporter);
globalizedElement.computeAllClassMembers(compiler);
// The nested function's 'this' is the same as the one for the outer
// function. It could be [null] if we are inside a static method.
« no previous file with comments | « pkg/compiler/lib/src/apiimpl.dart ('k') | pkg/compiler/lib/src/common/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698