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

Unified Diff: sdk/lib/_internal/pub/lib/src/validator/name.dart

Issue 486213004: Allow package names to start with underscore. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | sdk/lib/_internal/pub/test/validator/name_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/validator/name.dart
diff --git a/sdk/lib/_internal/pub/lib/src/validator/name.dart b/sdk/lib/_internal/pub/lib/src/validator/name.dart
index b939ac81fcf042ac4b502ed259bfc9dfcbc5b7f9..14da9120035bc4427d42f7e0f3c2196e95870f37 100644
--- a/sdk/lib/_internal/pub/lib/src/validator/name.dart
+++ b/sdk/lib/_internal/pub/lib/src/validator/name.dart
@@ -70,8 +70,8 @@ class NameValidator extends Validator {
messages.add("$description may only contain letters, numbers, and "
"underscores.\n"
"Using a valid Dart identifier makes the name usable in Dart code.");
- } else if (!new RegExp(r"^[a-zA-Z]").hasMatch(name)) {
- messages.add("$description must begin with letter.\n"
+ } else if (!new RegExp(r"^[a-zA-Z_]").hasMatch(name)) {
+ messages.add("$description must begin with a letter or underscore.\n"
"Using a valid Dart identifier makes the name usable in Dart code.");
} else if (_RESERVED_WORDS.contains(name.toLowerCase())) {
messages.add("$description may not be a reserved word in Dart.\n"
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/validator/name_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698