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

Unified Diff: utils/pub/system_cache.dart

Issue 12211061: Handle circular dependencies on the root package when checking SDK constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « utils/pub/entrypoint.dart ('k') | utils/tests/pub/sdk_constraint_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/system_cache.dart
diff --git a/utils/pub/system_cache.dart b/utils/pub/system_cache.dart
index 4041e40d8ac743faf18ef7e4770c3acd329305d2..1b5d9820b79ad20a7d43c410d63277511e833ca7 100644
--- a/utils/pub/system_cache.dart
+++ b/utils/pub/system_cache.dart
@@ -63,6 +63,8 @@ class SystemCache {
/// Gets the package identified by [id]. If the package is already cached,
/// reads it from the cache. Otherwise, requests it from the source.
Future<Pubspec> describe(PackageId id) {
+ if (id.isRoot) throw new ArgumentError("Cannot describe the root package.");
+
// Try to get it from the system cache first.
if (id.source.shouldCache) {
return id.systemCacheDirectory.then((packageDir) {
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/tests/pub/sdk_constraint_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698