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

Unified Diff: tests/lib/mirrors/symbol_validation_test.dart

Issue 140643006: Update documentation on Symbol. Make validation match. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
« sdk/lib/internal/symbol.dart ('K') | « sdk/lib/internal/symbol.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/symbol_validation_test.dart
diff --git a/tests/lib/mirrors/symbol_validation_test.dart b/tests/lib/mirrors/symbol_validation_test.dart
index 0fe3c45c3d412b142226754f67f66ee0473c4d18..732df336f5838a04b3a23269f43296b6b26b572b 100644
--- a/tests/lib/mirrors/symbol_validation_test.dart
+++ b/tests/lib/mirrors/symbol_validation_test.dart
@@ -36,4 +36,45 @@ main() {
['6', '0foo', ',', 'S with M', '_invalid&private']
.forEach(invalidSymbol);
+
+ // Reserved words are not valid identifiers and therefore not valid symbols.
+ var reservedWords = [
+ "assert",
+ "break",
+ "case",
+ "catch",
+ "class",
+ "const",
+ "continue",
+ "default",
+ "do",
+ "else",
+ "enum",
+ "extends",
+ "false",
+ "final",
+ "finally",
+ "for",
+ "if",
+ "in",
+ "is",
+ "new",
+ "null",
+ "rethrow",
+ "return",
+ "super",
+ "switch",
+ "this",
+ "throw",
+ "true",
+ "try",
+ "var",
+ "void",
+ "while",
+ "with"
+ ];
+ reservedWords.expand((w) => [w, "$w=", "x.$w" , "$w.x", "x.$w.x"])
+ .forEach(invalidSymbol);
}
+
+
« sdk/lib/internal/symbol.dart ('K') | « sdk/lib/internal/symbol.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698