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

Unified Diff: pkg/yaml/lib/src/yaml_map.dart

Issue 24175008: Add YamlMap.addAll. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/yaml/lib/src/yaml_map.dart
diff --git a/pkg/yaml/lib/src/yaml_map.dart b/pkg/yaml/lib/src/yaml_map.dart
index aa8397cfa6bb72fc5e11dd287365361d205af9a3..50ae2d95b942778ce5ec3e70492f30dfd83c7add 100644
--- a/pkg/yaml/lib/src/yaml_map.dart
+++ b/pkg/yaml/lib/src/yaml_map.dart
@@ -23,6 +23,12 @@ class YamlMap implements Map {
YamlMap._wrap(this._map);
+ void addAll(Map other) {
+ other.forEach((key, value) {
+ this[key] = value;
+ });
+ }
+
bool containsValue(value) => _map.containsValue(value);
bool containsKey(key) => _map.containsKey(_wrapKey(key));
operator [](key) => _map[_wrapKey(key)];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698