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

Unified Diff: pkg/polymer/lib/deserialize.dart

Issue 26734004: use symbol literals instead of const ctor in packages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/path/lib/path.dart ('k') | pkg/polymer/lib/src/declaration.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/deserialize.dart
diff --git a/pkg/polymer/lib/deserialize.dart b/pkg/polymer/lib/deserialize.dart
index 7f72c2c83aba4eec8ba4abb4c797d14ef23f9c78..62e8bec8451b06f6b0d346b8f6ae1989543057e4 100644
--- a/pkg/polymer/lib/deserialize.dart
+++ b/pkg/polymer/lib/deserialize.dart
@@ -10,9 +10,9 @@ import 'dart:mirrors' show reflect, TypeMirror;
final _typeHandlers = () {
// TODO(jmesserly): switch to map and symbol literal form when supported.
var m = new Map();
- m[const Symbol('dart.core.String')] = (x, _) => x;
- m[const Symbol('dart.core.Null')] = (x, _) => x;
- m[const Symbol('dart.core.DateTime')] = (x, _) {
+ m[#dart.core.String] = (x, _) => x;
+ m[#dart.core.Null] = (x, _) => x;
+ m[#dart.core.DateTime] = (x, _) {
// TODO(jmesserly): shouldn't need to try-catch here
// See: https://code.google.com/p/dart/issues/detail?id=1878
try {
@@ -21,10 +21,10 @@ final _typeHandlers = () {
return new DateTime.now();
}
};
- m[const Symbol('dart.core.bool')] = (x, _) => x != 'false';
- m[const Symbol('dart.core.int')] =
+ m[#dart.core.bool] = (x, _) => x != 'false';
+ m[#dart.core.int] =
(x, def) => int.parse(x, onError: (_) => def);
- m[const Symbol('dart.core.double')] =
+ m[#dart.core.double] =
(x, def) => double.parse(x, (_) => def);
return m;
}();
« no previous file with comments | « pkg/path/lib/path.dart ('k') | pkg/polymer/lib/src/declaration.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698