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

Unified Diff: pkg/front_end/lib/src/fasta/loader.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
Index: pkg/front_end/lib/src/fasta/loader.dart
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart
index a9e235747f9357aaebd18b1d67effb95b1693061..977e630e426a70edcc77da0a31582d89ee375533 100644
--- a/pkg/front_end/lib/src/fasta/loader.dart
+++ b/pkg/front_end/lib/src/fasta/loader.dart
@@ -10,7 +10,7 @@ import 'dart:collection' show Queue;
import 'builder/builder.dart' show Builder, LibraryBuilder;
-import 'errors.dart' show InputError, firstSourceUri;
+import 'errors.dart' show InputError, firstSourceUri, printUnexpected;
import 'target_implementation.dart' show TargetImplementation;
@@ -81,7 +81,14 @@ abstract class Loader<L> {
}
return library;
});
- // TODO(ahe): Check that [accessor] is allowed to access [builder].
+ if (accessor != null &&
+ uri.scheme == "dart" &&
+ uri.path.startsWith("_") &&
+ accessor.uri.scheme != "dart") {
+ const String message = "Can't access platform private library.";
+ printUnexpected(accessor.fileUri, charOffset, message);
+ errors.add(new InputError(accessor.fileUri, charOffset, message));
+ }
return builder;
}

Powered by Google App Engine
This is Rietveld 408576698