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 b67eccac8bc30049df452547ecab3585b033b7fa..ef849257dc88a75ce0ded686bb9239756087e5d1 100644 |
--- a/pkg/serialization/lib/src/mirrors_helpers.dart |
+++ b/pkg/serialization/lib/src/mirrors_helpers.dart |
@@ -18,7 +18,7 @@ import 'serialization_helpers.dart'; |
* fields. |
*/ |
List<VariableMirror> publicFields(ClassMirror mirror) { |
- var mine = mirror.variables.values.filter( |
+ var mine = mirror.variables.values.where( |
(x) => !(x.isPrivate || x.isStatic)); |
var mySuperclass = mirror.superclass; |
if (mySuperclass != mirror) { |
@@ -42,13 +42,13 @@ bool hasField(String name, ClassMirror mirror) { |
* Return a list of all the getters of a class, including inherited |
* getters. Note that this allows private getters, but excludes statics. |
*/ |
-List<MethodMirror> publicGetters(ClassMirror mirror) { |
- var mine = mirror.getters.values.filter((x) => !(x.isPrivate || x.isStatic)); |
+Iterable<MethodMirror> publicGetters(ClassMirror mirror) { |
+ var mine = mirror.getters.values.where((x) => !(x.isPrivate || x.isStatic)); |
var mySuperclass = mirror.superclass; |
if (mySuperclass != mirror) { |
return append(publicGetters(mirror.superclass), mine); |
} else { |
- return mine; |
+ return mine.toList(); |
} |
} |
@@ -67,8 +67,8 @@ bool hasGetter(String name, ClassMirror mirror) { |
*/ |
List<MethodMirror> publicGettersWithMatchingSetters(ClassMirror mirror) { |
var setters = mirror.setters; |
- return publicGetters(mirror).filter((each) => |
- setters["${each.simpleName}="] != null); |
+ return publicGetters(mirror).where((each) => |
+ setters["${each.simpleName}="] != null).toList(); |
} |
/** |
@@ -76,4 +76,4 @@ List<MethodMirror> publicGettersWithMatchingSetters(ClassMirror mirror) { |
* as literals, so we have to be passed an instance and then extract a |
* ClassMirror from that. Given a horrible name as an extra reminder to fix it. |
*/ |
-ClassMirror turnInstanceIntoSomethingWeCanUse(x) => reflect(x).type; |
+ClassMirror turnInstanceIntoSomethingWeCanUse(x) => reflect(x).type; |