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

Unified Diff: pkg/front_end/lib/src/fasta/builder/class_builder.dart

Issue 2916863003: Implement library access restrictions and privacy. (Closed)
Patch Set: Update status file. Created 3 years, 7 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 | « no previous file | pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26f5db8f392436d42dba78be2b5b8c4514c089a8..33f0d176fc93ca2e4b4c220599303c288c9e3207 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -75,21 +75,25 @@ abstract class ClassBuilder<T extends TypeBuilder, R>
int resolveConstructors(LibraryBuilder library) {
if (constructorReferences == null) return 0;
for (ConstructorReferenceBuilder ref in constructorReferences) {
- ref.resolveIn(scope);
+ ref.resolveIn(scope, library);
}
return constructorReferences.length;
}
/// Used to lookup a static member of this class.
- Builder findStaticBuilder(String name, int charOffset, Uri fileUri,
+ Builder findStaticBuilder(
+ String name, int charOffset, Uri fileUri, LibraryBuilder accessingLibrary,
{bool isSetter: false}) {
+ if (accessingLibrary != library && name.startsWith("_")) return null;
Builder builder = isSetter
? scope.lookupSetter(name, charOffset, fileUri, isInstanceScope: false)
: scope.lookup(name, charOffset, fileUri, isInstanceScope: false);
return builder;
}
- Builder findConstructorOrFactory(String name, int charOffset, Uri uri) {
+ Builder findConstructorOrFactory(
+ String name, int charOffset, Uri uri, LibraryBuilder accessingLibrary) {
+ if (accessingLibrary != library && name.startsWith("_")) return null;
return constructors.lookup(name, charOffset, uri);
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/builder/constructor_reference_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698