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

Unified Diff: lib/src/pubspec.dart

Issue 1417993002: Fix a bug in pubspec parsing. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | test/pubspec_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/pubspec.dart
diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart
index 19bd769fcef94b3cfe96bb9cd7ff758996080cab..28b1375cbf9e07ad52445b89d8e7c9c9f300db1a 100644
--- a/lib/src/pubspec.dart
+++ b/lib/src/pubspec.dart
@@ -463,6 +463,8 @@ class Pubspec {
var sourceNames = spec.keys.toList();
if (sourceNames.length > 1) {
_error('A dependency may only have one source.', specNode.span);
+ } else if (sourceNames.isEmpty) {
+ _error('A dependency must contain a source.', specNode.span);
}
sourceName = sourceNames.single;
« no previous file with comments | « no previous file | test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698