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

Unified Diff: pkg/compiler/lib/src/resolution/enum_creator.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/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/enum_creator.dart
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart
index 1102aad6f24051fb4562f8f8738af52af526487f..70099860c3323e308d0082443a0e749482a193ba 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -4,9 +4,11 @@
library dart2js.resolution.enum_creator;
-import '../compiler.dart';
-import '../core_types.dart';
+import '../core_types.dart' show
+ CoreTypes;
import '../dart_types.dart';
+import '../diagnostics/diagnostic_listener.dart' show
+ DiagnosticReporter;
import '../elements/elements.dart';
import '../elements/modelx.dart';
import '../tokens/keyword.dart' show
@@ -180,12 +182,11 @@ class AstBuilder {
}
class EnumCreator {
- final Compiler compiler;
+ final DiagnosticReporter reporter;
+ final CoreTypes coreTypes;
final EnumClassElementX enumClass;
- EnumCreator(this.compiler, this.enumClass);
-
- CoreTypes get coreTypes => compiler.coreTypes;
+ EnumCreator(this.reporter, this.coreTypes, this.enumClass);
void createMembers() {
Enum node = enumClass.node;
@@ -202,7 +203,7 @@ class EnumCreator {
variableList.type = type;
EnumFieldElementX variable = new EnumFieldElementX(
identifier, enumClass, variableList, identifier);
- enumClass.addMember(variable, compiler);
+ enumClass.addMember(variable, reporter);
return variable;
}
@@ -233,7 +234,7 @@ class EnumCreator {
type: new FunctionType(constructor, const VoidType(),
<DartType>[intType]));
constructor.functionSignatureCache = constructorSignature;
- enumClass.addMember(constructor, compiler);
+ enumClass.addMember(constructor, reporter);
List<FieldElement> enumValues = <FieldElement>[];
VariableList variableList =
@@ -265,7 +266,7 @@ class EnumCreator {
EnumFieldElementX field = new EnumFieldElementX(
name, enumClass, variableList, definition, initializer);
enumValues.add(field);
- enumClass.addMember(field, compiler);
+ enumClass.addMember(field, reporter);
index++;
}
@@ -284,7 +285,7 @@ class EnumCreator {
valuesIdentifier, enumClass, valuesVariableList,
definition, initializer);
- enumClass.addMember(valuesVariable, compiler);
+ enumClass.addMember(valuesVariable, reporter);
// TODO(johnniwinther): Support return type. Note `String` might be prefixed
// or not imported within the current library.
@@ -304,7 +305,7 @@ class EnumCreator {
FunctionSignatureX toStringSignature = new FunctionSignatureX(
type: new FunctionType(toString, stringType));
toString.functionSignatureCache = toStringSignature;
- enumClass.addMember(toString, compiler);
+ enumClass.addMember(toString, reporter);
enumClass.enumValues = enumValues;
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/constructors.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698