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

Unified Diff: pkg/serialization/lib/src/serialization_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/reader_writer.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/src/serialization_helpers.dart
diff --git a/pkg/serialization/lib/src/serialization_helpers.dart b/pkg/serialization/lib/src/serialization_helpers.dart
index 407c6562d2b765f6c5c5553e9f6e371672b3196b..a9954733e610a3594f5a25fc64b5b1d9e6e72d01 100644
--- a/pkg/serialization/lib/src/serialization_helpers.dart
+++ b/pkg/serialization/lib/src/serialization_helpers.dart
@@ -18,7 +18,7 @@ doNothing(x) => x;
/** Concatenate two lists. Handle the case where one or both might be null. */
// TODO(alanknight): Remove once issue 5342 is resolved.
-List append(Iterable a, Iterable b) {
+Iterable append(Iterable a, Iterable b) {
if (a == null) {
return (b == null) ? [] : new List.from(b);
}
@@ -77,7 +77,7 @@ abstract class MapLikeIterable {
* [collection] is a List, it will be the same as the map() method if the
* [key] parameter wasn't passed.
*/
- map(Function f) {
+ mappedBy(Function f) {
var result = copyEmpty();
forEach((key, value) {
result[key] = f(key, value);
@@ -133,7 +133,7 @@ values(x) {
mapValues(x, f) {
if (x is Set) return x.mappedBy(f).toSet();
if (x is Iterable) return x.mappedBy(f).toList();
- if (x is Map) return new ListLikeIterable(x).map(f);
+ if (x is Map) return new ListLikeIterable(x).mappedBy(f);
throw new ArgumentError("Invalid argument");
}
@@ -158,7 +158,7 @@ class ListLikeIterable {
* [collection] is a List, it will be the same as if map() had been called
* directly on [collection].
*/
- map(Function f) {
+ mappedBy(Function f) {
var result = new Map();
collection.forEach((key, value) => result[key] = f(value));
return result;
« no previous file with comments | « pkg/serialization/lib/src/reader_writer.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698