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

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

Issue 11820032: Make input/output formats pluggable, adapt to new libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes from review comments 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/format.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 b1b4d9f15ad49c30ec72ee20966d2095ddff9e73..aeeb5098bdcc68866d64273c3abf30daf2c7e762 100644
--- a/pkg/serialization/lib/src/mirrors_helpers.dart
+++ b/pkg/serialization/lib/src/mirrors_helpers.dart
@@ -17,9 +17,9 @@ import 'serialization_helpers.dart';
* Return a list of all the public fields of a class, including inherited
* fields.
*/
-List<VariableMirror> publicFields(ClassMirror mirror) {
+Iterable<VariableMirror> publicFields(ClassMirror mirror) {
var mine = mirror.variables.values.where(
- (x) => !(x.isPrivate || x.isStatic)).toList();
+ (x) => !(x.isPrivate || x.isStatic));
var mySuperclass = mirror.superclass;
if (mySuperclass != mirror) {
return append(publicFields(mirror.superclass), mine);
@@ -65,10 +65,10 @@ bool hasGetter(String name, ClassMirror mirror) {
* Return a list of all the public getters of a class which have corresponding
* setters.
*/
-List<MethodMirror> publicGettersWithMatchingSetters(ClassMirror mirror) {
+Iterable<MethodMirror> publicGettersWithMatchingSetters(ClassMirror mirror) {
var setters = mirror.setters;
return publicGetters(mirror).where((each) =>
- setters["${each.simpleName}="] != null).toList();
+ setters["${each.simpleName}="] != null);
}
/**
« no previous file with comments | « pkg/serialization/lib/src/format.dart ('k') | pkg/serialization/lib/src/reader_writer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698