Use the correct set of reserved identifiers in pub validations.

We had been using the set listed in the spec as "BUILT_IN_IDENTIFIER", but
apparently those are the built-in identifiers that are valid for user use. Now
we're using the set listed in the spec as "reserved words".

BUG=8628

Review URL: https://codereview.chromium.org//12301032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18716 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
nweiz@google.com 2013-02-19 19:55:40 +00:00
parent a1702c3578
commit d64b7d392a
2 changed files with 6 additions and 5 deletions

View file

@ -16,9 +16,10 @@ import '../validator.dart';
/// Dart reserved words, from the Dart spec.
final _RESERVED_WORDS = [
"abstract", "as", "dynamic", "export", "external", "factory", "get",
"implements", "import", "library", "operator", "part", "set", "static",
"typedef"
"assert", "break", "case", "catch", "class", "const", "continue", "default",
"do", "else", "extends", "false", "final", "finally", "for", "if", "in", "is",
"new", "null", "return", "super", "switch", "this", "throw", "true", "try",
"var", "void", "while", "with"
];
/// A validator that validates the name of the package and its libraries.

View file

@ -298,7 +298,7 @@ main() {
});
integration('has a package name that is a Dart reserved word', () {
dir(appPath, [libPubspec("operator", "1.0.0")]).scheduleCreate();
dir(appPath, [libPubspec("final", "1.0.0")]).scheduleCreate();
expectValidationError(name);
});
@ -329,7 +329,7 @@ main() {
integration('has a library name that is a Dart reserved word', () {
dir(appPath, [
libPubspec("test_pkg", "1.0.0"),
dir("lib", [file("operator.dart", "int i = 0;")])
dir("lib", [file("for.dart", "int i = 0;")])
]).scheduleCreate();
expectValidationError(name);
});