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

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

Issue 632483002: Printing a useful error message if a version field is a num (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging master Created 6 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
Index: sdk/lib/_internal/pub_generated/lib/src/pubspec.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/pubspec.dart b/sdk/lib/_internal/pub_generated/lib/src/pubspec.dart
index b8b28ed154b137d4d85339a71536410cea382528..d3dd3b82657ccdb0766c3c17c85521a460caa2eb 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/pubspec.dart
@@ -37,6 +37,14 @@ class Pubspec {
return _version;
}
var span = fields.nodes['version'].span;
+ if (version is num) {
+ var fixed = '$version.0';
+ if (version is int) {
+ fixed = '$fixed.0';
+ }
+ _error('"version" field must have three numeric components: major, '
+ 'minor, and patch. Instead of "$version", consider "$fixed".', span);
+ }
if (version is! String) {
_error('"version" field must be a string.', span);
}
« no previous file with comments | « sdk/lib/_internal/pub/test/pubspec_test.dart ('k') | sdk/lib/_internal/pub_generated/test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698