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

Unified Diff: sdk/lib/_internal/pub/lib/src/pubspec.dart

Issue 243683002: Refactor Source. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise all the things. Created 6 years, 8 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: sdk/lib/_internal/pub/lib/src/pubspec.dart
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index 759f01e19f9f26af5957d2386a5bb2ec52d544ba..9a4d3e34930a1b091f4cb0a2026d4b01cc385fe0 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -379,20 +379,18 @@ class Pubspec {
_error('"$field.$name" field must be a string or a mapping.');
}
- // If we have a valid source, use it to process the description. Allow
- // unknown sources so pub doesn't choke on old pubspecs.
- if (_sources.contains(sourceName)) {
- var descriptionField = "$field.$name";
- if (spec is Map) descriptionField = "$descriptionField.$sourceName";
- _wrapFormatException('description', descriptionField, () {
- var pubspecPath;
- if (_location != null && _isFileUri(_location)) {
- pubspecPath = path.fromUri(_location);
- }
- description = _sources[sourceName].parseDescription(
- pubspecPath, description, fromLockFile: false);
- });
- }
+ // Let the source validate the description.
+ var descriptionField = "$field.$name";
+ if (spec is Map) descriptionField = "$descriptionField.$sourceName";
+ _wrapFormatException('description', descriptionField, () {
+ var pubspecPath;
+ if (_location != null && _isFileUri(_location)) {
+ pubspecPath = path.fromUri(_location);
+ }
+
+ description = _sources[sourceName].parseDescription(
+ pubspecPath, description, fromLockFile: false);
+ });
dependencies.add(new PackageDep(
name, sourceName, versionConstraint, description));
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/lock_file.dart ('k') | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698