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

Unified Diff: dart/runtime/lib/symbol_patch.dart

Issue 14079003: Implement Symbol correctly in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 7 years, 8 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 | « dart/pkg/pkg.status ('k') | dart/sdk/lib/_collection_dev/symbol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/lib/symbol_patch.dart
diff --git a/dart/runtime/lib/symbol_patch.dart b/dart/runtime/lib/symbol_patch.dart
index df76a933315b69cbef435a977ae3d421b75d6e47..79cdec7b345bbee9a7e74e57eeb9578b831a6293 100644
--- a/dart/runtime/lib/symbol_patch.dart
+++ b/dart/runtime/lib/symbol_patch.dart
@@ -4,41 +4,5 @@
patch class Symbol {
/* patch */ const Symbol(String name)
- : this._name = _validate(name);
-
- static final RegExp _validationPattern =
- new RegExp(r'^(?:[a-zA-Z$][a-zA-Z$0-9_]*\.)*(?:[a-zA-Z$][a-zA-Z$0-9_]*=?|'
- r'-|'
- r'unary-|'
- r'\[\]=|'
- r'~|'
- r'==|'
- r'\[\]|'
- r'\*|'
- r'/|'
- r'%|'
- r'~/|'
- r'\+|'
- r'<<|'
- r'>>|'
- r'>=|'
- r'>|'
- r'<=|'
- r'<|'
- r'&|'
- r'\^|'
- r'\|'
- r')$');
-
- static _validate(String name) {
- if (name.isEmpty) return name;
- if (name.startsWith('_')) {
- throw new ArgumentError('"$name" is a private identifier');
- }
- if (!_validationPattern.hasMatch(name)) {
- throw new ArgumentError(
- '"$name" is not an identifier or an empty String');
- }
- return name;
- }
+ : this._name = validate(name);
}
« no previous file with comments | « dart/pkg/pkg.status ('k') | dart/sdk/lib/_collection_dev/symbol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698