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: pkg/front_end/lib/src/fasta/builder/class_builder.dart

Issue 2788913002: Prepare for separate setter scope. (Closed)
Patch Set: Address comments. Created 3 years, 9 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/builder/class_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/builder/class_builder.dart b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
index b87f675781bd82a8b06b42819beb5d5f62936405..f6af4e94ec6959d471b52439e6577ff9178c5d3f 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -11,6 +11,7 @@ import 'builder.dart'
Builder,
ConstructorReferenceBuilder,
LibraryBuilder,
+ MemberBuilder,
MetadataBuilder,
MixinApplicationBuilder,
NamedTypeBuilder,
@@ -74,9 +75,9 @@ abstract class ClassBuilder<T extends TypeBuilder, R>
for (TypeVariableBuilder t in typeVariables) {
local[t.name] = t;
}
- parent = new Scope(local, parent, isModifiable: false);
+ parent = new Scope(local, null, parent, isModifiable: false);
}
- return new Scope(membersInScope, parent, isModifiable: false);
+ return new Scope(membersInScope, null, parent, isModifiable: false);
}
/// Used to lookup a static member of this class.
@@ -123,7 +124,9 @@ abstract class ClassBuilder<T extends TypeBuilder, R>
}
}
- Builder findConstructorOrFactory(String name);
+ Builder findConstructorOrFactory(String name, int charOffset, Uri uri) {
+ return constructors[name];
+ }
/// Returns a map which maps the type variables of [superclass] to their
/// respective values as defined by the superclass clause of this class (and
@@ -188,6 +191,17 @@ abstract class ClassBuilder<T extends TypeBuilder, R>
return substitutionMap;
}
+ void forEach(void f(String name, MemberBuilder builder)) {
+ members.forEach(f);
+ }
+
+ /// Don't use for scope lookup. Only use when an element is known to exist
+ /// (and isn't a setter).
+ MemberBuilder operator [](String name) {
+ // TODO(ahe): Rename this to getLocalMember.
+ return members[name] ?? internalError("Not found: '$name'.");
+ }
+
void addCompileTimeError(int charOffset, String message) {
library.addCompileTimeError(charOffset, message, fileUri: fileUri);
}

Powered by Google App Engine
This is Rietveld 408576698