Reapply "Rename mappedBy to map."
This reverts commit r17907.
TBR.
Review URL: https://codereview.chromium.org//12090093
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/yaml@17918 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/model.dart b/lib/model.dart
index 8c111af..7a609b9 100644
--- a/lib/model.dart
+++ b/lib/model.dart
@@ -91,7 +91,7 @@
}
String toString() =>
- '$tag [${Strings.join(content.mappedBy((e) => '$e'), ', ')}]';
+ '$tag [${Strings.join(content.map((e) => '$e'), ', ')}]';
int get hashCode => super.hashCode ^ _hashCode(content);
@@ -150,7 +150,7 @@
// TODO(nweiz): This could be faster if we used a RegExp to check for
// special characters and short-circuited if they didn't exist.
- var escapedValue = value.charCodes.mappedBy((c) {
+ var escapedValue = value.charCodes.map((c) {
switch (c) {
case _Parser.TAB: return "\\t";
case _Parser.LF: return "\\n";
@@ -223,7 +223,7 @@
String toString() {
var strContent = content.keys
- .mappedBy((k) => '${k}: ${content[k]}')
+ .map((k) => '${k}: ${content[k]}')
.join(', ');
return '$tag {$strContent}';
}
diff --git a/lib/visitor.dart b/lib/visitor.dart
index b5c14c9..42dbb22 100644
--- a/lib/visitor.dart
+++ b/lib/visitor.dart
@@ -14,7 +14,7 @@
/// Visits each node in [seq] and returns a list of the results.
visitSequence(_SequenceNode seq)
- => seq.content.mappedBy((e) => e.visit(this)).toList();
+ => seq.content.map((e) => e.visit(this)).toList();
/// Visits each key and value in [map] and returns a map of the results.
visitMapping(_MappingNode map) {
diff --git a/lib/yaml.dart b/lib/yaml.dart
index ef0ac83..e905e76 100644
--- a/lib/yaml.dart
+++ b/lib/yaml.dart
@@ -60,8 +60,8 @@
/// are YamlMaps. These have a few small behavioral differences from the default
/// Map implementation; for details, see the YamlMap class.
List loadYamlStream(String yaml) {
- return new _Parser(yaml).l_yamlStream().mappedBy((doc) =>
- new _Constructor(new _Composer(doc).compose()).construct())
+ return new _Parser(yaml).l_yamlStream()
+ .map((doc) => new _Constructor(new _Composer(doc).compose()).construct())
.toList();
}
diff --git a/lib/yaml_map.dart b/lib/yaml_map.dart
index 65dd119..cbf18e5 100644
--- a/lib/yaml_map.dart
+++ b/lib/yaml_map.dart
@@ -29,7 +29,7 @@
void clear() => _map.clear();
void forEach(void f(key, value)) =>
_map.forEach((k, v) => f(_unwrapKey(k), v));
- Iterable get keys => _map.keys.mappedBy(_unwrapKey);
+ Iterable get keys => _map.keys.map(_unwrapKey);
Iterable get values => _map.values;
int get length => _map.length;
bool get isEmpty => _map.isEmpty;