Index: pkg/kernel/lib/target/targets.dart |
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart |
index 3227f012c7b72a3ae7ef275653378886a0a37049..91671416072c3d03e01fbef3d7a1d8e2006d604a 100644 |
--- a/pkg/kernel/lib/target/targets.dart |
+++ b/pkg/kernel/lib/target/targets.dart |
@@ -129,6 +129,15 @@ abstract class Target { |
bool mayDefineRestrictedType(Uri uri) => |
uri.scheme == 'dart' && uri.path == 'core'; |
+ /// Whether a library is allowed to import a platform private library. |
+ /// |
+ /// By default only `dart:*` libraries are allowed. May be overriden for |
+ /// testing purposes. |
+ bool allowPlatformPrivateLibraryAccess(Uri importer, Uri imported) => |
+ imported.scheme != "dart" || |
+ !imported.path.startsWith("_") || |
+ importer.scheme == "dart"; |
+ |
/// Whether the `native` language extension is supported within [library]. |
/// |
/// The `native` language extension is not part of the language specification, |