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

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

Issue 11553012: Better ability to have hand-written custom rules and various cleanups. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
Index: pkg/serialization/lib/src/basic_rule.dart
diff --git a/pkg/serialization/lib/src/basic_rule.dart b/pkg/serialization/lib/src/basic_rule.dart
index df1cae7bc4d895828059d3988174b8b0dfa99202..bfc19145cec7e183284d08bdfa01a372806ea6d9 100644
--- a/pkg/serialization/lib/src/basic_rule.dart
+++ b/pkg/serialization/lib/src/basic_rule.dart
@@ -170,7 +170,7 @@ class BasicRule extends SerializationRule {
checkForEssentialLists(index, value) {
if (value is List && fields.contents[index].isEssential) {
return new DesignatedRuleForObject(value,
- (index) => index is ListRuleEssential);
+ (SerializationRule rule) => rule is ListRuleEssential);
} else {
return value;
}
@@ -206,7 +206,7 @@ class BasicRule extends SerializationRule {
* this is true if the type mirrors are the same.
*/
// TODO(alanknight): This seems likely to be slow. Verify. Other options?
- bool appliesTo(object) => reflect(object).type == type;
+ bool appliesTo(object, Writer w) => reflect(object).type == type;
/**
* Given the various field lists provided by the user, construct the list
@@ -492,7 +492,7 @@ class _FieldList implements Iterable {
* Provide a typedef for the setWith argument to specialTreatmentFor. It would
* be nice if we could put this closer to the definition.
*/
-typedef SetWithFunction(InstanceMirror m, Object o);
+typedef SetWithFunction(InstanceMirror m, object);
/**
* This represents a constructor that is to be used when re-creating a

Powered by Google App Engine
This is Rietveld 408576698