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

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

Issue 59383009: Add a reserved namespace (himBHinitial identifiers) for transformer configuration. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/pubspec_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/pubspec.dart
diff --git a/sdk/lib/_internal/pub/lib/src/pubspec.dart b/sdk/lib/_internal/pub/lib/src/pubspec.dart
index ee9106735ddc3dd3dfa96bf63e2537d01922eeff..bcef655b914a6e5a1fc6eb1d298d0ae2a7e2642a 100644
--- a/sdk/lib/_internal/pub/lib/src/pubspec.dart
+++ b/sdk/lib/_internal/pub/lib/src/pubspec.dart
@@ -150,6 +150,15 @@ class Pubspec {
_error('"$field.$library" field must be a map, but was '
'"$configuration".');
}
+
+ var reservedKeys = configuration.keys
+ .where((key) => key is String && key.startsWith(r'$'))
+ .map((key) => '"$key"');
+ if (reservedKeys.isNotEmpty) {
+ _error('"$field.$library" field cannot contain reserved '
+ '${pluralize('field', reservedKeys.length)} '
+ '${toSentence(reservedKeys)}.');
+ }
}
var id = _wrapFormatException("transformer identifier",
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698