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

Unified Diff: pkg/serialization/lib/src/mirrors_helpers.dart

Issue 13982012: Update pkg/serialization to use Symbols and synchronous mirrors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « pkg/serialization/lib/src/basic_rule.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/src/mirrors_helpers.dart
diff --git a/pkg/serialization/lib/src/mirrors_helpers.dart b/pkg/serialization/lib/src/mirrors_helpers.dart
index aeeb5098bdcc68866d64273c3abf30daf2c7e762..4058514a18d4992d586e78a8e36db04af57dba52 100644
--- a/pkg/serialization/lib/src/mirrors_helpers.dart
+++ b/pkg/serialization/lib/src/mirrors_helpers.dart
@@ -30,7 +30,8 @@ Iterable<VariableMirror> publicFields(ClassMirror mirror) {
/** Return true if the class has a field named [name]. Note that this
* includes private fields, but excludes statics. */
-bool hasField(String name, ClassMirror mirror) {
+bool hasField(Symbol name, ClassMirror mirror) {
+ if (name == null) return false;
var field = mirror.variables[name];
if (field != null && !field.isStatic) return true;
var superclass = mirror.superclass;
@@ -53,7 +54,8 @@ Iterable<MethodMirror> publicGetters(ClassMirror mirror) {
}
/** Return true if the class has a getter named [name] */
-bool hasGetter(String name, ClassMirror mirror) {
+bool hasGetter(Symbol name, ClassMirror mirror) {
+ if (name == null) return false;
var getter = mirror.getters[name];
if (getter != null && !getter.isStatic) return true;
var superclass = mirror.superclass;
« no previous file with comments | « pkg/serialization/lib/src/basic_rule.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698