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

Unified Diff: pkg/template_binding/test/custom_element_bindings_test.dart

Issue 246833003: Revert "Remove unmodifiable map wrappers that could instead use UnmodifiableMapView." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | pkg/yaml/lib/src/yaml_map.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/template_binding/test/custom_element_bindings_test.dart
diff --git a/pkg/template_binding/test/custom_element_bindings_test.dart b/pkg/template_binding/test/custom_element_bindings_test.dart
index d015825592fc8a17b888960e7cb378558e0a17c2..62fb8ee24e12b6a33f514301973d54c73cffb19b 100644
--- a/pkg/template_binding/test/custom_element_bindings_test.dart
+++ b/pkg/template_binding/test/custom_element_bindings_test.dart
@@ -215,18 +215,34 @@ class WithAttrsCustomElement extends HtmlElement {
}
// TODO(jmesserly): would be nice to use mocks when mirrors work on dart2js.
-class AttributeMapWrapper<K, V> extends MapView<K, V> {
+class AttributeMapWrapper<K, V> implements Map<K, V> {
final List log = [];
+ Map<K, V> _map;
- AttributeMapWrapper(Map map) : super(map);
+ AttributeMapWrapper(this._map);
+
+ bool containsValue(Object value) => _map.containsValue(value);
+ bool containsKey(Object key) => _map.containsKey(key);
+ V operator [](Object key) => _map[key];
void operator []=(K key, V value) {
log.add(['[]=', key, value]);
- super[key] = value;
+ _map[key] = value;
}
+ V putIfAbsent(K key, V ifAbsent()) => _map.putIfAbsent(key, ifAbsent);
+
V remove(Object key) {
log.add(['remove', key]);
- super.remove(key);
+ _map.remove(key);
}
+
+ void addAll(Map<K, V> other) => _map.addAll(other);
+ void clear() => _map.clear();
+ void forEach(void f(K key, V value)) => _map.forEach(f);
+ Iterable<K> get keys => _map.keys;
+ Iterable<V> get values => _map.values;
+ int get length => _map.length;
+ bool get isEmpty => _map.isEmpty;
+ bool get isNotEmpty => _map.isNotEmpty;
}
« no previous file with comments | « no previous file | pkg/yaml/lib/src/yaml_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698