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

Unified Diff: pkg/serialization/lib/serialization.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/path/lib/path.dart ('k') | pkg/serialization/lib/src/basic_rule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/serialization.dart
diff --git a/pkg/serialization/lib/serialization.dart b/pkg/serialization/lib/serialization.dart
index b5d107440401629ee9f7214b92d4f53f9da02721..2b1377280a35a2e7fd74a23f7dc3811e17cdd0e7 100644
--- a/pkg/serialization/lib/serialization.dart
+++ b/pkg/serialization/lib/serialization.dart
@@ -149,7 +149,8 @@ library serialization;
import 'src/mirrors_helpers.dart';
import 'src/serialization_helpers.dart';
-import 'dart:json' show JSON;
+import 'dart:async';
+import 'dart:json' as json;
part 'src/reader_writer.dart';
part 'src/serialization_rule.dart';
@@ -201,7 +202,7 @@ class Serialization {
*/
bool get selfDescribing {
if (_selfDescribing != null) return _selfDescribing;
- return !_rules.some((x) => x is CustomRule);
+ return !_rules.any((x) => x is CustomRule);
}
/**
@@ -362,8 +363,8 @@ class Serialization {
target = object;
candidateRules = _rules;
}
- List applicable = candidateRules.filter(
- (each) => each.appliesTo(target, w));
+ List applicable =
+ candidateRules.where((each) => each.appliesTo(target, w)).toList();
if (applicable.isEmpty) {
return [addRuleFor(target)];
@@ -371,8 +372,8 @@ class Serialization {
if (applicable.length == 1) return applicable;
var first = applicable[0];
- var finalRules = applicable.filter(
- (x) => !x.mustBePrimary || (x == first));
+ var finalRules = applicable.where(
+ (x) => !x.mustBePrimary || (x == first)).toList();
if (finalRules.isEmpty) throw new SerializationException(
'No valid rule found for object $object');
@@ -436,4 +437,4 @@ class Serialization {
class SerializationException implements Exception {
final String message;
const SerializationException([this.message]);
-}
+}
« no previous file with comments | « pkg/path/lib/path.dart ('k') | pkg/serialization/lib/src/basic_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698