Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/lock_file.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/lock_file.dart b/sdk/lib/_internal/pub/lib/src/lock_file.dart |
| index 1e85a4d0e37f080c2bae62b9d59ccccc66dc06f1..e9799be3002115301dc0e25af7480c5e4d297a55 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/lock_file.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/lock_file.dart |
| @@ -62,17 +62,20 @@ class LockFile { |
| throw new FormatException( |
| 'Could not find a source named $sourceName.'); |
| } |
| - var source = sources[sourceName]; |
| - // Parse the description. |
| if (!spec.containsKey('description')) { |
| throw new FormatException('Package $name is missing a description.'); |
| } |
| var description = spec['description']; |
| - description = source.parseDescription(filePath, description, |
| - fromLockFile: true); |
| - var id = new PackageId(name, source, version, description); |
| + // Parse the description if we know the source. |
| + if (sources.contains(sourceName)) { |
|
nweiz
2013/05/17 23:55:55
This is already checked on l61. Did you mean to re
Bob Nystrom
2013/05/20 20:06:00
Removed the previous check and added a test that c
|
| + var source = sources[sourceName]; |
| + description = source.parseDescription(filePath, description, |
| + fromLockFile: true); |
| + } |
| + |
| + var id = new PackageId(name, sourceName, version, description); |
| // Validate the name. |
| if (name != id.name) { |
| @@ -97,7 +100,7 @@ class LockFile { |
| sortedKeys.forEach((name) { |
| packagesObj[name] = { |
| 'version': packages[name].version.toString(), |
| - 'source': packages[name].source.name, |
| + 'source': packages[name].source, |
| 'description': packages[name].description |
| }; |
| }); |