Index: sdk/lib/_internal/pub/lib/src/package.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/package.dart b/sdk/lib/_internal/pub/lib/src/package.dart |
index 63ed342342888dd28b7d5dc6496da1afc4bf0892..ec9d6a57fa73b36ef1a70bc0db9fa59f8f6112f2 100644 |
--- a/sdk/lib/_internal/pub/lib/src/package.dart |
+++ b/sdk/lib/_internal/pub/lib/src/package.dart |
@@ -62,7 +62,7 @@ class Package { |
/// `null` if the package being loaded is the entrypoint package. |
Package.load(String name, String packageDir, SourceRegistry sources) |
: dir = packageDir, |
- pubspec = new Pubspec.load(name, packageDir, sources); |
+ pubspec = new Pubspec.load(packageDir, sources, expectedName: name); |
/// Constructs a package with the given pubspec. The package will have no |
/// directory associated with it. |
@@ -190,31 +190,3 @@ class PackageDep extends _PackageName { |
other.constraint == constraint; |
} |
} |
- |
-class PubspecNotFoundException extends ApplicationException { |
- final String name; |
- |
- PubspecNotFoundException(String name) |
- : name = name, |
- super('Package "$name" doesn\'t have a pubspec.yaml file.'); |
-} |
- |
-class PubspecHasNoNameException extends ApplicationException { |
- final String name; |
- |
- PubspecHasNoNameException(String name) |
- : name = name, |
- super('Package "$name"\'s pubspec.yaml file is missing the ' |
- 'required "name" field (e.g. "name: $name").'); |
-} |
- |
-class PubspecNameMismatchException extends ApplicationException { |
- final String expectedName; |
- final String actualName; |
- |
- PubspecNameMismatchException(String expectedName, String actualName) |
- : expectedName = expectedName, |
- actualName = actualName, |
- super('The name you specified for your dependency, "$expectedName", ' |
- 'doesn\'t match the name "$actualName" in its pubspec.'); |
-} |