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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « pkg/serialization/lib/src/basic_rule.dart ('k') | pkg/serialization/lib/src/reader_writer.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 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;
« no previous file with comments | « pkg/serialization/lib/src/basic_rule.dart ('k') | pkg/serialization/lib/src/reader_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698